Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/polyml/files/
Date: Sun, 27 Sep 2020 00:15:03
Message-Id: 1601165688.bda071544c420ea8b908c5704ec26b7f484f4557.conikost@gentoo
1 commit: bda071544c420ea8b908c5704ec26b7f484f4557
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Sat Sep 26 14:35:42 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 27 00:14:48 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bda07154
7
8 dev-lang/polyml: remove unused patches
9
10 Closes: https://github.com/gentoo/gentoo/pull/17682
11 Package-Manager: Portage-3.0.8, Repoman-3.0.1
12 Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
13 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
14
15 dev-lang/polyml/files/polyml-5.4.1-asm.patch | 28 ----
16 dev-lang/polyml/files/polyml-5.4.1-configure.patch | 11 --
17 dev-lang/polyml/files/polyml-5.5.0-asm.patch | 10 --
18 dev-lang/polyml/files/polyml-5.5.0-configure.patch | 138 --------------------
19 .../polyml/files/polyml-5.5.0-x-it-basis.patch | 21 ---
20 ...polyml-5.5.1-inputN-return-for-zero-chars.patch | 33 -----
21 .../files/polyml-5.5.1-optimize-closure.patch | 141 ---------------------
22 ....5.2-r1952-check_for_negative_sized_array.patch | 13 --
23 ...ult_in_FFI_when_malloc_runs_out_of_memory.patch | 112 ----------------
24 ...the_large_object_cache_pointer_is_cleared.patch | 27 ----
25 ...largeObjectCache_fully_in_the_constructor.patch | 21 ---
26 11 files changed, 555 deletions(-)
27
28 diff --git a/dev-lang/polyml/files/polyml-5.4.1-asm.patch b/dev-lang/polyml/files/polyml-5.4.1-asm.patch
29 deleted file mode 100644
30 index af8bd8d4914..00000000000
31 --- a/dev-lang/polyml/files/polyml-5.4.1-asm.patch
32 +++ /dev/null
33 @@ -1,28 +0,0 @@
34 ---- polyml.5.4.1-orig/libpolyml/x86asm.asm 2011-07-13 00:06:49.000000000 +1000
35 -+++ polyml.5.4.1/libpolyml/x86asm.asm 2012-01-08 16:00:09.740684843 +1100
36 -@@ -2714,4 +2714,7 @@
37 -
38 -
39 - ENDIF
40 -+#if defined(__linux__) && defined(__ELF__)
41 -+.section .note.GNU-stack,"",%progbits
42 -+#endif
43 - END
44 ---- polyml.5.4.1-orig/libpolyml/power_assembly.S 2010-04-09 01:49:20.000000000 +1000
45 -+++ polyml.5.4.1/libpolyml/power_assembly.S 2012-01-08 15:46:35.006200143 +1100
46 -@@ -1735,3 +1735,6 @@
47 - dd Mask_assign_byte /* 254 */
48 - dd Mask_assign_word /* 255 */
49 -
50 -+#if defined(__linux__) && defined(__ELF__)
51 -+.section .note.GNU-stack,"",%progbits
52 -+#endif
53 ---- polyml.5.4.1-orig/libpolyml/sparc_assembly.S 2010-08-13 01:01:36.000000000 +1000
54 -+++ polyml.5.4.1/libpolyml/sparc_assembly.S 2012-01-08 15:46:12.516642791 +1100
55 -@@ -1498,3 +1498,6 @@
56 - .long Mask_assign_byte /* 254 */
57 - .long Mask_assign_word /* 255 */
58 -
59 -+#if defined(__linux__) && defined(__ELF__)
60 -+.section .note.GNU-stack,"",%progbits
61 -+#endif
62
63 diff --git a/dev-lang/polyml/files/polyml-5.4.1-configure.patch b/dev-lang/polyml/files/polyml-5.4.1-configure.patch
64 deleted file mode 100644
65 index aaaed02f8e1..00000000000
66 --- a/dev-lang/polyml/files/polyml-5.4.1-configure.patch
67 +++ /dev/null
68 @@ -1,11 +0,0 @@
69 ---- polyml.5.4.1-orig/configure.ac 2010-09-03 21:22:40.000000000 +1000
70 -+++ polyml.5.4.1/configure.ac 2012-01-09 22:44:04.153668402 +1100
71 -@@ -321,7 +321,7 @@
72 - AC_ARG_WITH([portable],
73 - [AS_HELP_STRING([--with-portable],
74 - [Build the portable interpreter version of Poly/ML instead of native @<:@default=no@:>@])], [
75 -- ac_cv_with_portable=yes], [
76 -+ ac_cv_with_portable="$withval"], [
77 - ac_cv_with_portable=no])
78 -
79 - case "${host_cpu}" in
80
81 diff --git a/dev-lang/polyml/files/polyml-5.5.0-asm.patch b/dev-lang/polyml/files/polyml-5.5.0-asm.patch
82 deleted file mode 100644
83 index cffa627b9f3..00000000000
84 --- a/dev-lang/polyml/files/polyml-5.5.0-asm.patch
85 +++ /dev/null
86 @@ -1,10 +0,0 @@
87 ---- polyml.5.5-orig/libpolyml/x86asm.asm 2012-05-03 21:07:59.000000000 +1000
88 -+++ polyml.5.5/libpolyml/x86asm.asm 2012-09-19 17:41:51.767737295 +1000
89 -@@ -3003,4 +3003,7 @@
90 - dd Mask_assign_byte ;# 254
91 - dd Mask_assign_word ;# 255
92 -
93 -+#if defined(__linux__) && defined(__ELF__)
94 -+.section .note.GNU-stack,"",%progbits
95 -+#endif
96 - END
97
98 diff --git a/dev-lang/polyml/files/polyml-5.5.0-configure.patch b/dev-lang/polyml/files/polyml-5.5.0-configure.patch
99 deleted file mode 100644
100 index 1a2e114e650..00000000000
101 --- a/dev-lang/polyml/files/polyml-5.5.0-configure.patch
102 +++ /dev/null
103 @@ -1,138 +0,0 @@
104 -Index: polyml/configure
105 -===================================================================
106 ---- polyml/configure (revision 1599)
107 -+++ polyml/configure (revision 1600)
108 -@@ -20870,10 +20870,8 @@
109 - # Check whether --with-portable was given.
110 - if test "${with_portable+set}" = set; then :
111 - withval=$with_portable;
112 -- ac_cv_with_portable=yes
113 - else
114 --
115 -- ac_cv_with_portable=no
116 -+ with_portable=check
117 - fi
118 -
119 -
120 -@@ -20894,36 +20892,46 @@
121 -
122 - $as_echo "#define HOSTARCHITECTURE_SPARC 1" >>confdefs.h
123 -
124 -- ac_cv_with_portable=yes
125 -+ polyarch=interpret
126 - ;;
127 - power* | ppc*)
128 -
129 - $as_echo "#define HOSTARCHITECTURE_PPC 1" >>confdefs.h
130 -
131 -- ac_cv_with_portable=yes
132 -+ polyarch=interpret
133 - ;;
134 - arm*)
135 -
136 - $as_echo "#define HOSTARCHITECTURE_ARM 1" >>confdefs.h
137 -
138 -- ac_cv_with_portable=yes
139 -+ polyarch=interpret
140 - ;;
141 - ia64*)
142 -
143 - $as_echo "#define HOSTARCHITECTURE_IA64 1" >>confdefs.h
144 -
145 -- ac_cv_with_portable=yes
146 -+ polyarch=interpret
147 - ;;
148 - *) as_fn_error $? "Poly/ML is not supported for this architecture" "$LINENO" 5 ;;
149 - esac
150 -
151 --# If we have explicitly set --with-portable or we are on a machine without
152 --# a code-generator set to use the interpreter.
153 --if test "$ac_cv_with_portable" = "yes"; then
154 -+# If we explicitly asked to use the interpreter set the architecture to interpreted.
155 -+if test "x$with_portable" = "xyes" ; then
156 -+ polyarch=interpret
157 -+fi
158 -
159 -+# If we asked not to use the interpreter check we have native code support.
160 -+if test "x$with_portable" = "xno" ; then
161 -+ if test "x$polyarch" = "xinterpret" ; then
162 -+ as_fn_error $? "--without-portable was given but native code is not supported on this platform" "$LINENO" 5
163 -+ fi
164 -+fi
165 -+
166 -+# Set the define if this is the interpreter. This is no longer actually used.
167 -+if test "x$polyarch" = "xinterpret" ; then
168 -+
169 - $as_echo "#define INTERPRETED 1" >>confdefs.h
170 -
171 -- polyarch=interpret
172 - fi
173 -
174 - # Put this test at the end where it's less likely to be missed.
175 -Index: polyml/configure.ac
176 -===================================================================
177 ---- polyml/configure.ac (revision 1599)
178 -+++ polyml/configure.ac (revision 1600)
179 -@@ -368,10 +368,10 @@
180 - # Test the --with-portable option to build the interpreter even if
181 - # we have a code-generator.
182 - AC_ARG_WITH([portable],
183 -- [AS_HELP_STRING([--with-portable],
184 -- [Build the portable interpreter version of Poly/ML instead of native @<:@default=no@:>@])], [
185 -- ac_cv_with_portable=yes], [
186 -- ac_cv_with_portable=no])
187 -+ [AS_HELP_STRING([--with-portable],
188 -+ [Build the portable interpreter version of Poly/ML instead of native @<:@default=no@:>@])],
189 -+ [],
190 -+ [with_portable=check])
191 -
192 - case "${host_cpu}" in
193 - i[[3456]]86*)
194 -@@ -384,28 +384,39 @@
195 - ;;
196 - sparc*)
197 - AC_DEFINE([HOSTARCHITECTURE_SPARC], [1], [Define if the host is a Sparc (32 bit)])
198 -- ac_cv_with_portable=yes
199 -+ polyarch=interpret
200 - ;;
201 - power* | ppc*)
202 - AC_DEFINE([HOSTARCHITECTURE_PPC], [1], [Define if the host is a Power PC (32 bit)])
203 -- ac_cv_with_portable=yes
204 -+ polyarch=interpret
205 - ;;
206 - arm*)
207 - AC_DEFINE([HOSTARCHITECTURE_ARM], [1], [Define if the host is an ARM (32 bit)])
208 -- ac_cv_with_portable=yes
209 -+ polyarch=interpret
210 - ;;
211 - ia64*)
212 - AC_DEFINE([HOSTARCHITECTURE_IA64], [1], [Define if the host is Itanium])
213 -- ac_cv_with_portable=yes
214 -+ polyarch=interpret
215 - ;;
216 - *) AC_MSG_ERROR([Poly/ML is not supported for this architecture]) ;;
217 - esac
218 -
219 --# If we have explicitly set --with-portable or we are on a machine without
220 --# a code-generator set to use the interpreter.
221 --if test "$ac_cv_with_portable" = "yes"; then
222 -+# If we explicitly asked to use the interpreter set the architecture to interpreted.
223 -+if test "x$with_portable" = "xyes" ; then
224 -+ polyarch=interpret
225 -+fi
226 -+
227 -+# If we asked not to use the interpreter check we have native code support.
228 -+if test "x$with_portable" = "xno" ; then
229 -+ if test "x$polyarch" = "xinterpret" ; then
230 -+ AC_MSG_ERROR(
231 -+ [--without-portable was given but native code is not supported on this platform])
232 -+ fi
233 -+fi
234 -+
235 -+# Set the define if this is the interpreter. This is no longer actually used.
236 -+if test "x$polyarch" = "xinterpret" ; then
237 - AC_DEFINE([INTERPRETED], [1], [Define if using the interpreter] )
238 -- polyarch=interpret
239 - fi
240 -
241 - # Put this test at the end where it's less likely to be missed.
242
243 diff --git a/dev-lang/polyml/files/polyml-5.5.0-x-it-basis.patch b/dev-lang/polyml/files/polyml-5.5.0-x-it-basis.patch
244 deleted file mode 100644
245 index 2f6ce7b864b..00000000000
246 --- a/dev-lang/polyml/files/polyml-5.5.0-x-it-basis.patch
247 +++ /dev/null
248 @@ -1,21 +0,0 @@
249 -Index: polyml/mlsource/extra/XWindows/ml_bind.ML
250 -===================================================================
251 ---- polyml/mlsource/extra/XWindows/ml_bind.ML (revision 1600)
252 -+++ polyml/mlsource/extra/XWindows/ml_bind.ML (revision 1601)
253 -@@ -2437,7 +2437,7 @@
254 -
255 - exception XWindows = XWindows.XWindows;
256 -
257 --let
258 -+local
259 - open XWindows;
260 -
261 - fun printRect _ _ (r:XRectangle) =
262 -@@ -2447,6 +2447,6 @@
263 - PolyML.PrettyString ("Rect " ^ PolyML.makestring R)
264 - end;
265 - in
266 -- PolyML.addPrettyPrinter printRect
267 -+ val () = PolyML.addPrettyPrinter printRect
268 - end;
269 -
270
271 diff --git a/dev-lang/polyml/files/polyml-5.5.1-inputN-return-for-zero-chars.patch b/dev-lang/polyml/files/polyml-5.5.1-inputN-return-for-zero-chars.patch
272 deleted file mode 100644
273 index 8f5b02ee908..00000000000
274 --- a/dev-lang/polyml/files/polyml-5.5.1-inputN-return-for-zero-chars.patch
275 +++ /dev/null
276 @@ -1,33 +0,0 @@
277 -https://sourceforge.net/p/polyml/code/1875/
278 -Required for sci-mathematics/isabelle-2013.2
279 -
280 -------------------------------------------------------------------------
281 -r1875 | dcjm | 2013-10-30 10:49:05 -0600 (Wed, 30 Oct 2013) | 1 line
282 -
283 -Backport commit 1874 from trunk. This fixes TextIO.inputN and StreamIO.inputN so they return immediately if the request is for zero characters.
284 -Index: polyml/basis/BasicStreamIO.sml
285 -===================================================================
286 ---- polyml/basis/BasicStreamIO.sml (revision 1851)
287 -+++ polyml/basis/BasicStreamIO.sml (working copy)
288 -@@ -213,6 +213,8 @@
289 - fun inputN (f, n) =
290 - if n < 0
291 - then raise Size
292 -+ else if n = 0 (* Defined to return the empty vector and f *)
293 -+ then (emptyVec, f)
294 - else
295 - let
296 - val (vecs, f') = inputNList (f, n)
297 -Index: polyml/basis/TextIO.sml
298 -===================================================================
299 ---- polyml/basis/TextIO.sml (revision 1851)
300 -+++ polyml/basis/TextIO.sml (working copy)
301 -@@ -597,6 +597,8 @@
302 - | inputN' n (ref(Direct(strm as {buffer, bufp, buflimit, ...}))) =
303 - if n < 0 orelse n > CharVector.maxLen
304 - then raise Size
305 -+ else if n = 0
306 -+ then "" (* Return the empty string without blocking *)
307 - else if !buflimit = 0
308 - then (* Last read returned end-of-file. Clear the EOF state once
309 - we return this empty string. *)
310
311 diff --git a/dev-lang/polyml/files/polyml-5.5.1-optimize-closure.patch b/dev-lang/polyml/files/polyml-5.5.1-optimize-closure.patch
312 deleted file mode 100644
313 index 5b33203d69e..00000000000
314 --- a/dev-lang/polyml/files/polyml-5.5.1-optimize-closure.patch
315 +++ /dev/null
316 @@ -1,141 +0,0 @@
317 -https://sourceforge.net/p/polyml/code/1869/
318 -Required for sci-mathematics/isabelle-2013.2
319 -
320 -------------------------------------------------------------------------
321 -r1869 | dcjm | 2013-10-11 05:59:58 -0600 (Fri, 11 Oct 2013) | 1 line
322 -
323 -Back-port commits 1855 and 1867 from trunk. These fix two optimiser bugs. Includes the regression tests.
324 -
325 -Index: polyml/mlsource/MLCompiler/CodeTree/CODETREE_OPTIMISER.sml
326 -===================================================================
327 ---- polyml/mlsource/MLCompiler/CodeTree/CODETREE_OPTIMISER.sml (revision 1851)
328 -+++ polyml/mlsource/MLCompiler/CodeTree/CODETREE_OPTIMISER.sml (working copy)
329 -@@ -645,8 +645,9 @@
330 - (thisDec :: decs, thisArg @ args, LoadLocal newAddr :: mapList)
331 - end
332 -
333 -- | mapPattern(ArgPattCurry(currying, ArgPattTuple{allConst=false, filter, ...}) :: patts, n, m) =
334 -- (* It's a function that returns a tuple. *)
335 -+ | mapPattern(ArgPattCurry(currying as [_], ArgPattTuple{allConst=false, filter, ...}) :: patts, n, m) =
336 -+ (* It's a function that returns a tuple. The function must not be curried because
337 -+ otherwise it returns a function not a tuple. *)
338 - let
339 - val (thisDec, thisArg, thisMap) =
340 - transformFunctionArgument(currying, [LoadArgument m], [LoadArgument n], SOME filter)
341 -@@ -657,7 +658,7 @@
342 -
343 - | mapPattern(ArgPattCurry(currying as firstArgSet :: _, _) :: patts, n, m) =
344 - (* Transform it if it's curried or if there is a tuple in the first arg. *)
345 -- if List.length currying >= 2 orelse
346 -+ if (*List.length currying >= 2 orelse *) (* This transformation is unsafe. *)
347 - List.exists(fn ArgPattTuple{allConst=false, ...} => true | _ => false) firstArgSet
348 - then
349 - let
350 -@@ -685,6 +686,13 @@
351 -
352 - and transformFunctionArgument(argumentArgs, loadPack, loadThisArg, filterOpt) =
353 - let
354 -+ (* Disable the transformation of curried arguments for the moment.
355 -+ This is unsafe. See Test146. The problem is that this transformation
356 -+ is only safe if the function is applied immediately to all the arguments.
357 -+ However the usage information is propagated so that if the result of
358 -+ the first application is bound to a variable and then that variable is
359 -+ applied it still appears as curried. *)
360 -+ val argumentArgs = [hd argumentArgs]
361 - (* We have a function that takes a series of curried argument.
362 - Change that so that the function takes a list of arguments. *)
363 - val newAddr = ! localCounter before localCounter := ! localCounter + 1
364 -@@ -1214,9 +1222,11 @@
365 - let
366 - fun checkArg (ArgPattTuple{allConst=false, ...}) = true
367 - (* Function has at least one tupled arg. *)
368 -- | checkArg (ArgPattCurry(_, ArgPattTuple{allConst=false, ...})) = true
369 -- (* Function has an arg that is a function that returns a tuple. *)
370 -- | checkArg (ArgPattCurry(_ :: _ :: _, _)) = true
371 -+ | checkArg (ArgPattCurry([_], ArgPattTuple{allConst=false, ...})) = true
372 -+ (* Function has an arg that is a function that returns a tuple.
373 -+ It must not be curried otherwise it returns a function not a tuple. *)
374 -+ (* This transformation is unsafe. See comment in transformFunctionArgument above. *)
375 -+ (*| checkArg (ArgPattCurry(_ :: _ :: _, _)) = true *)
376 - (* Function has an arg that is a curried function. *)
377 - | checkArg (ArgPattCurry(firstArgSet :: _, _)) =
378 - (* Function has an arg that is a function that
379 -Index: polyml/Tests/Succeed/Test146.ML
380 -===================================================================
381 ---- polyml/Tests/Succeed/Test146.ML (revision 0)
382 -+++ polyml/Tests/Succeed/Test146.ML (revision 1875)
383 -@@ -0,0 +1,24 @@
384 -+(* Bug in transformation of arguments which are curried functions. It is not
385 -+ safe to transform "f" in the argument to "bar". Although it is curried
386 -+ the application to the first argument "()" is not immediately followed
387 -+ by the application to the second. *)
388 -+
389 -+local
390 -+ val r = ref 0
391 -+in
392 -+ (* Foo should be called exactly once *)
393 -+ fun foo () = (r:= !r+1; fn i => i)
394 -+
395 -+ fun checkOnce () = if !r = 1 then () else raise Fail "bad"
396 -+end;
397 -+
398 -+fun bar f = let val r = f() in (r 1; r 2; List.map r [1, 2, 3]) end;
399 -+
400 -+bar foo;
401 -+
402 -+checkOnce();
403 -+
404 -+exception A and B and C;
405 -+fun rA () = raise A and rB () = raise B;
406 -+fun h (f, g) = let val a = f() in g(); a () end;
407 -+h(rA, rB) handle A => ();
408 -
409 -Property changes on: polyml/Tests/Succeed/Test146.ML
410 -___________________________________________________________________
411 -Added: svn:eol-style
412 -## -0,0 +1 ##
413 -+native
414 -\ No newline at end of property
415 -Index: polyml/Tests/Succeed/Test147.ML
416 -===================================================================
417 ---- polyml/Tests/Succeed/Test147.ML (revision 0)
418 -+++ polyml/Tests/Succeed/Test147.ML (revision 1875)
419 -@@ -0,0 +1,31 @@
420 -+(* Bug in optimiser transformation. A function argument that returns a tuple
421 -+ can be transformed to take a container but only if it is not curried. *)
422 -+
423 -+(* Cut down example from Isabelle that caused an internal error exception. *)
424 -+
425 -+fun one _ [] = raise Fail "bad"
426 -+ | one pred (x :: xs) =
427 -+ if pred x then (x, xs) else raise Fail "bad";
428 -+
429 -+fun foo (scan, f) xs = let val (x, y) = scan xs in (f x, y) end;
430 -+
431 -+fun bar (scan1, scan2) xs =
432 -+ let
433 -+ val (x, ys) = scan1 xs;
434 -+ val (y, zs) = scan2 x ys;
435 -+ in ((x, y), zs) end;
436 -+
437 -+fun bub (scan1, scan2) = foo(bar(scan1, (fn _ => scan2)), op ^);
438 -+
439 -+val qqq: string list -> string * int = bub(one (fn _ => raise Match), (foo((fn _ => raise Match), String.concat)));
440 -+
441 -+(* Further example - This caused a segfault. *)
442 -+
443 -+PolyML.Compiler.maxInlineSize := 1;
444 -+fun f g = let val (x,y) = g 1 2 in x+y end;
445 -+
446 -+fun r (x, y, z) = fn _ => (x, y+z);
447 -+
448 -+val h: int-> int*int = r (4,5,6);
449 -+
450 -+f (fn _ => h);
451 -
452 -Property changes on: polyml/Tests/Succeed/Test147.ML
453 -___________________________________________________________________
454 -Added: svn:eol-style
455 -## -0,0 +1 ##
456 -+native
457 -\ No newline at end of property
458
459 diff --git a/dev-lang/polyml/files/polyml-5.5.2-r1952-check_for_negative_sized_array.patch b/dev-lang/polyml/files/polyml-5.5.2-r1952-check_for_negative_sized_array.patch
460 deleted file mode 100644
461 index 1451d2df8d8..00000000000
462 --- a/dev-lang/polyml/files/polyml-5.5.2-r1952-check_for_negative_sized_array.patch
463 +++ /dev/null
464 @@ -1,13 +0,0 @@
465 -Index: polyml/basis/Array.sml
466 -===================================================================
467 ---- polyml/basis/Array.sml (revision 1951)
468 -+++ polyml/basis/Array.sml (revision 1952)
469 -@@ -129,7 +129,7 @@
470 -
471 - fun array(len, a) =
472 - let
473 -- val () = if len >= maxLen then raise General.Size else ()
474 -+ val () = if len < 0 orelse len >= maxLen then raise General.Size else ()
475 - val vec = System_alloc(len+1, 0wx40, RunCall.unsafeCast a)
476 - in
477 - System_setw(vec, 0, RunCall.unsafeCast len);
478
479 diff --git a/dev-lang/polyml/files/polyml-5.5.2-r1954_Fix_segfault_in_FFI_when_malloc_runs_out_of_memory.patch b/dev-lang/polyml/files/polyml-5.5.2-r1954_Fix_segfault_in_FFI_when_malloc_runs_out_of_memory.patch
480 deleted file mode 100644
481 index 783577026f6..00000000000
482 --- a/dev-lang/polyml/files/polyml-5.5.2-r1954_Fix_segfault_in_FFI_when_malloc_runs_out_of_memory.patch
483 +++ /dev/null
484 @@ -1,112 +0,0 @@
485 -Index: polyml/libpolyml/foreign.cpp
486 -===================================================================
487 ---- polyml/libpolyml/foreign.cpp (revision 1953)
488 -+++ polyml/libpolyml/foreign.cpp (revision 1954)
489 -@@ -4,7 +4,7 @@
490 -
491 - Copyright (c) 2000-7
492 - Cambridge University Technical Services Limited
493 -- Further development Copyright David C.J. Matthews 2008-2011.
494 -+ Further development Copyright David C.J. Matthews 2008-2014.
495 -
496 - This library is free software; you can redistribute it and/or
497 - modify it under the terms of the GNU Lesser General Public
498 -@@ -251,6 +251,10 @@
499 -
500 - static Volatile *vols;
501 - static PLock volLock; // Mutex to protect vols.
502 -+// TODO: There is a theoretical risk of deadlock if any ML allocation is made while this
503 -+// lock is held. An allocation can result in a GC which requires all threads to release
504 -+// ML memory but another thread could block waiting for the mutex.
505 -+// N.B. raising an exception involves an allocation.
506 -
507 - #define FIRST_VOL 0
508 -
509 -@@ -268,24 +272,8 @@
510 - static unsigned callBackEntries = 0;
511 - static PLock callbackTableLock; // Mutex to protect table.
512 -
513 --
514 - /**********************************************************************
515 - *
516 -- * Malloc / Free Wrappers
517 -- *
518 -- **********************************************************************/
519 --
520 --static POLYUNSIGNED malloc_count = 0;
521 --#if 0
522 --#define Vmalloc(where,size) {where = malloc(size); printf("malloc: %p,%d\n",where,size); fflush(stdout); malloc_count++;}
523 --#else
524 --#define Vmalloc(where,size) {where = malloc(size); malloc_count++;}
525 --#endif
526 --#define Vfree(p) { free(p); malloc_count--;}
527 --
528 --
529 --/**********************************************************************
530 -- *
531 - * Volatile Allocation
532 - *
533 - **********************************************************************/
534 -@@ -349,8 +337,12 @@
535 - PLocker plocker(&volLock);
536 - Handle res = vol_alloc(taskData);
537 - trace(("size= %" POLYUFMT "\n",size));
538 -- Vmalloc( C_POINTER(UNVOLHANDLE(res)), size );
539 -+ void *p = malloc(size);
540 -+ if (p == 0)
541 -+ RAISE_EXN("Insufficient memory");
542 -+ C_POINTER(UNVOLHANDLE(res)) = p;
543 - OWN_C_SPACE(UNVOLHANDLE(res)) = true;
544 -+
545 - return res;
546 - }
547 -
548 -@@ -685,7 +677,7 @@
549 - {
550 - // Can now free this.
551 - trace(("Freeing malloc space of <%" POLYUFMT ">\n",from));
552 -- Vfree(vols[from].C_pointer);
553 -+ free(vols[from].C_pointer);
554 - vols[from].C_pointer = 0;
555 - vols[from].Own_C_space = false;
556 - }
557 -@@ -702,7 +694,6 @@
558 - }
559 - }
560 - next_vol = to;
561 -- info(("unfreed mallocs=<%" POLYUFMT "> next_vol=<%" POLYUFMT ">\n", malloc_count, next_vol));
562 -
563 - /* Callback table. Added DCJM 12/4/04. We always process these as strong references.
564 - For the time being at any rate we treat these as permanent entries so that once a
565 -@@ -910,8 +901,9 @@
566 - RAISE_EXN("libffi error: ffi_prep_cif failed");
567 -
568 - // malloc memory for the result
569 -- void *result;
570 -- Vmalloc(result, result_type->size);
571 -+ void *result = malloc(result_type->size);
572 -+ if (result == 0)
573 -+ RAISE_EXN("Insufficient memory to allocate space for result");
574 -
575 - processes->ThreadReleaseMLMemory(taskData);
576 - ffi_call(&cif, sym, result, arg_values);
577 -@@ -1580,6 +1572,9 @@
578 -
579 - unsigned num_args = length_list(argTypeList->Word());
580 - ffi_type **arg_types = (ffi_type**)malloc(num_args * sizeof(ffi_type*));
581 -+ if (arg_types == 0)
582 -+ RAISE_EXN("Insufficient memory to allocate space for arguments");
583 -+
584 - PolyWord p = argTypeList->Word();
585 - for (POLYUNSIGNED i=0; i<num_args; i++,p=Tail(p))
586 - arg_types[i] = ctypeToFfiType(taskData, Head(p));
587 -@@ -1587,6 +1582,9 @@
588 -
589 - // The cif needs to be on the heap so that it is available in the callback.
590 - ffi_cif *cif = (ffi_cif *)malloc(sizeof(ffi_cif));
591 -+ if (cif == 0)
592 -+ RAISE_EXN("Insufficient memory to allocate space for cif");
593 -+
594 - if (ffi_prep_cif(cif, abi, num_args, result_type, arg_types) != FFI_OK)
595 - RAISE_EXN("libffi error: ffi_prep_cif failed");
596 -
597
598 diff --git a/dev-lang/polyml/files/polyml-5.5.2-r2007_Ensure_the_large_object_cache_pointer_is_cleared.patch b/dev-lang/polyml/files/polyml-5.5.2-r2007_Ensure_the_large_object_cache_pointer_is_cleared.patch
599 deleted file mode 100644
600 index 36c82947f37..00000000000
601 --- a/dev-lang/polyml/files/polyml-5.5.2-r2007_Ensure_the_large_object_cache_pointer_is_cleared.patch
602 +++ /dev/null
603 @@ -1,27 +0,0 @@
604 -Index: polyml/libpolyml/gc_mark_phase.cpp
605 -===================================================================
606 ---- polyml/libpolyml/gc_mark_phase.cpp (revision 2006)
607 -+++ polyml/libpolyml/gc_mark_phase.cpp (revision 2007)
608 -@@ -130,13 +130,6 @@
609 - if (locPtr == LARGECACHE_SIZE) locPtr = 0;
610 - largeObjectCache[locPtr].base = obj;
611 - largeObjectCache[locPtr].current = currentPtr;
612 -- // To try to narrow down a bug that results in the ASSERT failing,
613 -- // add these extra checks.
614 -- POLYUNSIGNED lengthWord = obj->LengthWord();
615 -- ASSERT (OBJ_IS_LENGTH(lengthWord));
616 -- POLYUNSIGNED length = OBJ_OBJECT_LENGTH(lengthWord);
617 -- ASSERT(length == originalLength);
618 -- ASSERT(currentPtr > (PolyWord*)obj && currentPtr < ((PolyWord*)obj)+length);
619 - }
620 - }
621 - else StackOverflow(obj);
622 -@@ -579,6 +572,8 @@
623 - ASSERT(nInUse == 0);
624 - MTGCProcessMarkPointers *marker = &markStacks[0];
625 - marker->active = true;
626 -+ marker->locPtr = 0;
627 -+ marker->largeObjectCache[0].base = 0;
628 - nInUse = 1;
629 -
630 - // Scan the permanent mutable areas.
631
632 diff --git a/dev-lang/polyml/files/polyml-5.5.2-r2009_Initialise_the_largeObjectCache_fully_in_the_constructor.patch b/dev-lang/polyml/files/polyml-5.5.2-r2009_Initialise_the_largeObjectCache_fully_in_the_constructor.patch
633 deleted file mode 100644
634 index 0629f12f72c..00000000000
635 --- a/dev-lang/polyml/files/polyml-5.5.2-r2009_Initialise_the_largeObjectCache_fully_in_the_constructor.patch
636 +++ /dev/null
637 @@ -1,21 +0,0 @@
638 -Index: polyml/libpolyml/gc_mark_phase.cpp
639 -===================================================================
640 ---- polyml/libpolyml/gc_mark_phase.cpp (revision 2008)
641 -+++ polyml/libpolyml/gc_mark_phase.cpp (revision 2009)
642 -@@ -176,6 +176,16 @@
643 - // Clear the mark stack
644 - for (unsigned i = 0; i < MARK_STACK_SIZE; i++)
645 - markStack[i] = 0;
646 -+ // Clear the large object cache. Actually only largeObjectCache[0].base
647 -+ // needs to be set to zero and for the objects allocated on the heap it is
648 -+ // cleared before each GC in either MarkRoots or MarkPointersTask.
649 -+ // The remianing case is the RescanMarked sub-class which is allocated on the stack
650 -+ // but it doesn't hurt to clear it in all cases.
651 -+ for (unsigned j = 0; j < LARGECACHE_SIZE; j++)
652 -+ {
653 -+ largeObjectCache[locPtr].base = 0;
654 -+ largeObjectCache[locPtr].current = 0;
655 -+ }
656 - }
657 -
658 - // Called when the stack has overflowed. We need to include this