1 |
commit: acd4823ddb0c5236b0ba3af45e5d9a4129b7b4e5 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 3 17:48:40 2016 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 18:29:42 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acd4823d |
7 |
|
8 |
dev-ml/core_kernel: fix build with ocaml 4.03 |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org> |
12 |
|
13 |
dev-ml/core_kernel/core_kernel-113.33.01.ebuild | 4 + |
14 |
dev-ml/core_kernel/files/oc43.patch | 581 ++++++++++++++++++++++++ |
15 |
2 files changed, 585 insertions(+) |
16 |
|
17 |
diff --git a/dev-ml/core_kernel/core_kernel-113.33.01.ebuild b/dev-ml/core_kernel/core_kernel-113.33.01.ebuild |
18 |
index 7777667..2f5da5d 100644 |
19 |
--- a/dev-ml/core_kernel/core_kernel-113.33.01.ebuild |
20 |
+++ b/dev-ml/core_kernel/core_kernel-113.33.01.ebuild |
21 |
@@ -34,6 +34,10 @@ RDEPEND=" |
22 |
" |
23 |
DEPEND="${RDEPEND}" |
24 |
|
25 |
+src_prepare() { |
26 |
+ has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch" |
27 |
+} |
28 |
+ |
29 |
src_configure() { |
30 |
emake setup.exe |
31 |
OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure |
32 |
|
33 |
diff --git a/dev-ml/core_kernel/files/oc43.patch b/dev-ml/core_kernel/files/oc43.patch |
34 |
new file mode 100644 |
35 |
index 0000000..da1ad5a |
36 |
--- /dev/null |
37 |
+++ b/dev-ml/core_kernel/files/oc43.patch |
38 |
@@ -0,0 +1,581 @@ |
39 |
+diff -uNr core_kernel-113.33.01/check_caml_modify/caml_modify.ml core_kernel-113.33.01+4.03/check_caml_modify/caml_modify.ml |
40 |
+--- core_kernel-113.33.01/check_caml_modify/caml_modify.ml 2016-03-22 11:37:07.000000000 +0100 |
41 |
++++ core_kernel-113.33.01+4.03/check_caml_modify/caml_modify.ml 2016-03-22 15:15:54.000000000 +0100 |
42 |
+@@ -1,5 +1,5 @@ |
43 |
+-external count : unit -> int = "check_caml_modify_count" "noalloc" |
44 |
+-external reset : unit -> unit = "check_caml_modify_reset" "noalloc" |
45 |
++external count : unit -> int = "check_caml_modify_count" [@@noalloc] |
46 |
++external reset : unit -> unit = "check_caml_modify_reset" [@@noalloc] |
47 |
+ |
48 |
+ let%test_unit _ = |
49 |
+ let x = Array.make (32 * 1024) [Random.int 10] in |
50 |
+diff -uNr core_kernel-113.33.01/check_caml_modify/caml_modify.mli core_kernel-113.33.01+4.03/check_caml_modify/caml_modify.mli |
51 |
+--- core_kernel-113.33.01/check_caml_modify/caml_modify.mli 2016-03-22 11:37:07.000000000 +0100 |
52 |
++++ core_kernel-113.33.01+4.03/check_caml_modify/caml_modify.mli 2016-03-22 15:15:54.000000000 +0100 |
53 |
+@@ -6,7 +6,7 @@ |
54 |
+ |
55 |
+ (** [count ()] returns the number of times [caml_modify] has been called since the last |
56 |
+ call to {!reset}. *) |
57 |
+-external count : unit -> int = "check_caml_modify_count" "noalloc" |
58 |
++external count : unit -> int = "check_caml_modify_count" [@@noalloc] |
59 |
+ |
60 |
+ (** [reset ()] reset the counter to [0]. *) |
61 |
+-external reset : unit -> unit = "check_caml_modify_reset" "noalloc" |
62 |
++external reset : unit -> unit = "check_caml_modify_reset" [@@noalloc] |
63 |
+diff -uNr core_kernel-113.33.01/_oasis core_kernel-113.33.01+4.03/_oasis |
64 |
+--- core_kernel-113.33.01/_oasis 2016-03-22 11:37:07.000000000 +0100 |
65 |
++++ core_kernel-113.33.01+4.03/_oasis 2016-03-22 15:15:54.000000000 +0100 |
66 |
+@@ -1,8 +1,8 @@ |
67 |
+ OASISFormat: 0.4 |
68 |
+-OCamlVersion: >= 4.02.3 |
69 |
++OCamlVersion: >= 4.03.0 |
70 |
+ FindlibVersion: >= 1.3.2 |
71 |
+ Name: core_kernel |
72 |
+-Version: 113.33.01 |
73 |
++Version: 113.33.01+4.03 |
74 |
+ Synopsis: Industrial strength alternative to OCaml's standard library |
75 |
+ Authors: Jane Street Group, LLC <opensource@××××××××××.com> |
76 |
+ Copyrights: (C) 2008-2016 Jane Street Group LLC <opensource@××××××××××.com> |
77 |
+diff -uNr core_kernel-113.33.01/opam core_kernel-113.33.01+4.03/opam |
78 |
+--- core_kernel-113.33.01/opam 2016-03-22 11:43:53.000000000 +0100 |
79 |
++++ core_kernel-113.33.01+4.03/opam 2016-03-22 17:51:34.000000000 +0100 |
80 |
+@@ -25,4 +25,4 @@ |
81 |
+ "typerep" |
82 |
+ "variantslib" |
83 |
+ ] |
84 |
+-available: [ ocaml-version >= "4.02.3" ] |
85 |
++available: [ ocaml-version >= "4.03.0" ] |
86 |
+diff -uNr core_kernel-113.33.01/src/bigstring.ml core_kernel-113.33.01+4.03/src/bigstring.ml |
87 |
+--- core_kernel-113.33.01/src/bigstring.ml 2016-03-22 11:37:07.000000000 +0100 |
88 |
++++ core_kernel-113.33.01+4.03/src/bigstring.ml 2016-03-22 15:15:54.000000000 +0100 |
89 |
+@@ -16,6 +16,8 @@ |
90 |
+ |
91 |
+ external aux_create: max_mem_waiting_gc:int -> size:int -> t = "bigstring_alloc" |
92 |
+ |
93 |
++external test_allocation : unit -> 'a = "core_bigstring_test_allocation" |
94 |
++ |
95 |
+ let create ?max_mem_waiting_gc size = |
96 |
+ let max_mem_waiting_gc = |
97 |
+ match max_mem_waiting_gc with |
98 |
+@@ -35,6 +37,7 @@ |
99 |
+ let max_mem_waiting_gc = Byte_units.create mem_units 256. in |
100 |
+ for _ = 0 to large_int do |
101 |
+ let (_ : t) = create ~max_mem_waiting_gc large_int in |
102 |
++ ignore (test_allocation ()); (* ensure we allocate something *) |
103 |
+ () |
104 |
+ done; |
105 |
+ Alarm.delete alarm; |
106 |
+@@ -48,7 +51,7 @@ |
107 |
+ |
108 |
+ let length = Array1.dim |
109 |
+ |
110 |
+-external is_mmapped : t -> bool = "bigstring_is_mmapped_stub" "noalloc" |
111 |
++external is_mmapped : t -> bool = "bigstring_is_mmapped_stub" [@@noalloc] |
112 |
+ |
113 |
+ let init n ~f = |
114 |
+ let t = create n in |
115 |
+@@ -119,7 +122,7 @@ |
116 |
+ (struct |
117 |
+ external unsafe_blit |
118 |
+ : src : string -> src_pos : int -> dst : t -> dst_pos : int -> len : int -> unit |
119 |
+- = "bigstring_blit_string_bigstring_stub" "noalloc" |
120 |
++ = "bigstring_blit_string_bigstring_stub" [@@noalloc] |
121 |
+ include Bigstring_sequence |
122 |
+ end) |
123 |
+ ;; |
124 |
+@@ -131,7 +134,7 @@ |
125 |
+ (struct |
126 |
+ external unsafe_blit |
127 |
+ : src : t -> src_pos : int -> dst : string -> dst_pos : int -> len : int -> unit |
128 |
+- = "bigstring_blit_bigstring_string_stub" "noalloc" |
129 |
++ = "bigstring_blit_bigstring_string_stub" [@@noalloc] |
130 |
+ include String_sequence |
131 |
+ end) |
132 |
+ ;; |
133 |
+@@ -200,7 +203,7 @@ |
134 |
+ |
135 |
+ external unsafe_memcmp |
136 |
+ : t1 : t -> t1_pos : int -> t2 : t -> t2_pos : int -> len : int -> int |
137 |
+- = "bigstring_memcmp_stub" "noalloc" |
138 |
++ = "bigstring_memcmp_stub" [@@noalloc] |
139 |
+ |
140 |
+ let compare t1 t2 = |
141 |
+ if phys_equal t1 t2 then 0 else |
142 |
+@@ -395,7 +398,7 @@ |
143 |
+ |
144 |
+ (* Search *) |
145 |
+ |
146 |
+-external unsafe_find : t -> char -> pos:int -> len:int -> int = "bigstring_find" "noalloc" |
147 |
++external unsafe_find : t -> char -> pos:int -> len:int -> int = "bigstring_find" [@@noalloc] |
148 |
+ |
149 |
+ let find ?(pos = 0) ?len chr bstr = |
150 |
+ let len = get_opt_len bstr ~pos len in |
151 |
+diff -uNr core_kernel-113.33.01/src/bigstring.mli core_kernel-113.33.01+4.03/src/bigstring.mli |
152 |
+--- core_kernel-113.33.01/src/bigstring.mli 2016-03-22 11:37:07.000000000 +0100 |
153 |
++++ core_kernel-113.33.01+4.03/src/bigstring.mli 2016-03-22 15:15:54.000000000 +0100 |
154 |
+@@ -83,7 +83,7 @@ |
155 |
+ (** [set t pos] sets the character at [pos] *) |
156 |
+ external set : t -> int -> char -> unit = "%caml_ba_set_1" |
157 |
+ |
158 |
+-external is_mmapped : t -> bool = "bigstring_is_mmapped_stub" "noalloc" |
159 |
++external is_mmapped : t -> bool = "bigstring_is_mmapped_stub" [@@noalloc] |
160 |
+ (** [is_mmapped bstr] @return whether the bigstring [bstr] is |
161 |
+ memory-mapped. *) |
162 |
+ |
163 |
+@@ -159,7 +159,7 @@ |
164 |
+ |
165 |
+ (** Same as [find], but does no bounds checking, and returns a negative value instead of |
166 |
+ [None] if [char] is not found. *) |
167 |
+-external unsafe_find : t -> char -> pos:int -> len:int -> int = "bigstring_find" "noalloc" |
168 |
++external unsafe_find : t -> char -> pos:int -> len:int -> int = "bigstring_find" [@@noalloc] |
169 |
+ |
170 |
+ |
171 |
+ (** {6 Destruction} *) |
172 |
+diff -uNr core_kernel-113.33.01/src/bigstring_stubs.c core_kernel-113.33.01+4.03/src/bigstring_stubs.c |
173 |
+--- core_kernel-113.33.01/src/bigstring_stubs.c 2016-03-22 11:37:07.000000000 +0100 |
174 |
++++ core_kernel-113.33.01+4.03/src/bigstring_stubs.c 2016-03-22 15:15:54.000000000 +0100 |
175 |
+@@ -202,3 +202,14 @@ |
176 |
+ core_bigstring_destroy(Caml_ba_array_val(v_bstr), 0); |
177 |
+ return Val_unit; |
178 |
+ } |
179 |
++ |
180 |
++CAMLprim value core_bigstring_test_allocation(value v_unit) |
181 |
++{ |
182 |
++ int i; |
183 |
++ value v; |
184 |
++ v_unit = v_unit; |
185 |
++ for (i = 0; i < 20; i++) { |
186 |
++ v = caml_alloc_small(100, 0); |
187 |
++ } |
188 |
++ return v; |
189 |
++} |
190 |
+diff -uNr core_kernel-113.33.01/src/core_array.ml core_kernel-113.33.01+4.03/src/core_array.ml |
191 |
+--- core_kernel-113.33.01/src/core_array.ml 2016-03-22 11:37:07.000000000 +0100 |
192 |
++++ core_kernel-113.33.01+4.03/src/core_array.ml 2016-03-22 15:15:54.000000000 +0100 |
193 |
+@@ -937,7 +937,7 @@ |
194 |
+ module Unsafe_blit = struct |
195 |
+ external unsafe_blit |
196 |
+ : src:t_ -> src_pos:int -> dst:t_ -> dst_pos:int -> len:int -> unit |
197 |
+- = "core_array_unsafe_int_blit" "noalloc" |
198 |
++ = "core_array_unsafe_int_blit" [@@noalloc] |
199 |
+ end |
200 |
+ |
201 |
+ include |
202 |
+@@ -966,7 +966,7 @@ |
203 |
+ module Unsafe_blit = struct |
204 |
+ external unsafe_blit |
205 |
+ : src:t_ -> src_pos:int -> dst:t_ -> dst_pos:int -> len:int -> unit |
206 |
+- = "core_array_unsafe_float_blit" "noalloc" |
207 |
++ = "core_array_unsafe_float_blit" [@@noalloc] |
208 |
+ end |
209 |
+ |
210 |
+ include |
211 |
+@@ -1131,7 +1131,7 @@ |
212 |
+ |
213 |
+ external unsafe_blit |
214 |
+ : src:[> read] t -> src_pos:int -> dst:[> write] t -> dst_pos:int -> len:int -> unit |
215 |
+- = "core_array_unsafe_int_blit" "noalloc" |
216 |
++ = "core_array_unsafe_int_blit" [@@noalloc] |
217 |
+ end |
218 |
+ |
219 |
+ module Float : sig |
220 |
+@@ -1141,7 +1141,7 @@ |
221 |
+ |
222 |
+ external unsafe_blit |
223 |
+ : src:[> read] t -> src_pos:int -> dst:[> write] t -> dst_pos:int -> len:int -> unit |
224 |
+- = "core_array_unsafe_float_blit" "noalloc" |
225 |
++ = "core_array_unsafe_float_blit" [@@noalloc] |
226 |
+ end |
227 |
+ |
228 |
+ val of_array_id : 'a array -> ('a, [< read_write]) t |
229 |
+diff -uNr core_kernel-113.33.01/src/core_array.mli core_kernel-113.33.01+4.03/src/core_array.mli |
230 |
+--- core_kernel-113.33.01/src/core_array.mli 2016-03-22 11:37:07.000000000 +0100 |
231 |
++++ core_kernel-113.33.01+4.03/src/core_array.mli 2016-03-22 15:15:54.000000000 +0100 |
232 |
+@@ -97,7 +97,7 @@ |
233 |
+ |
234 |
+ external unsafe_blit |
235 |
+ : src:t -> src_pos:int -> dst:t -> dst_pos:int -> len:int -> unit |
236 |
+- = "core_array_unsafe_int_blit" "noalloc" |
237 |
++ = "core_array_unsafe_int_blit" [@@noalloc] |
238 |
+ end |
239 |
+ |
240 |
+ module Float : sig |
241 |
+@@ -107,7 +107,7 @@ |
242 |
+ |
243 |
+ external unsafe_blit |
244 |
+ : src:t -> src_pos:int -> dst:t -> dst_pos:int -> len:int -> unit |
245 |
+- = "core_array_unsafe_float_blit" "noalloc" |
246 |
++ = "core_array_unsafe_float_blit" [@@noalloc] |
247 |
+ end |
248 |
+ |
249 |
+ (** [Array.of_list l] returns a fresh array containing the elements of [l]. *) |
250 |
+@@ -332,7 +332,7 @@ |
251 |
+ |
252 |
+ external unsafe_blit |
253 |
+ : src:[> read] t -> src_pos:int -> dst:[> write] t -> dst_pos:int -> len:int -> unit |
254 |
+- = "core_array_unsafe_int_blit" "noalloc" |
255 |
++ = "core_array_unsafe_int_blit" [@@noalloc] |
256 |
+ end |
257 |
+ |
258 |
+ module Float : sig |
259 |
+@@ -342,7 +342,7 @@ |
260 |
+ |
261 |
+ external unsafe_blit |
262 |
+ : src:[> read] t -> src_pos:int -> dst:[> write] t -> dst_pos:int -> len:int -> unit |
263 |
+- = "core_array_unsafe_float_blit" "noalloc" |
264 |
++ = "core_array_unsafe_float_blit" [@@noalloc] |
265 |
+ end |
266 |
+ |
267 |
+ (** [of_array_id] and [to_array_id] return the same underlying array. On the other |
268 |
+diff -uNr core_kernel-113.33.01/src/core_gc.ml core_kernel-113.33.01+4.03/src/core_gc.ml |
269 |
+--- core_kernel-113.33.01/src/core_gc.ml 2016-03-22 11:37:07.000000000 +0100 |
270 |
++++ core_kernel-113.33.01+4.03/src/core_gc.ml 2016-03-22 15:15:54.000000000 +0100 |
271 |
+@@ -83,6 +83,7 @@ |
272 |
+ the first-fit policy, which can be slower in some cases but can be better for |
273 |
+ programs with fragmentation problems. Default: 0. *) |
274 |
+ mutable allocation_policy : int; |
275 |
++ window_size : int; |
276 |
+ } [@@deriving compare, bin_io, sexp, fields] |
277 |
+ end |
278 |
+ |
279 |
+@@ -91,7 +92,8 @@ |
280 |
+ end |
281 |
+ |
282 |
+ let tune ?logger ?minor_heap_size ?major_heap_increment ?space_overhead |
283 |
+- ?verbose ?max_overhead ?stack_limit ?allocation_policy () = |
284 |
++ ?verbose ?max_overhead ?stack_limit ?allocation_policy |
285 |
++ ?window_size () = |
286 |
+ let module Field = Fieldslib.Field in |
287 |
+ let old_control_params = get () in |
288 |
+ let f opt to_string field = |
289 |
+@@ -113,6 +115,7 @@ |
290 |
+ ~max_overhead: (f max_overhead string_of_int) |
291 |
+ ~stack_limit: (f stack_limit string_of_int) |
292 |
+ ~allocation_policy: (f allocation_policy string_of_int) |
293 |
++ ~window_size: (f window_size string_of_int) |
294 |
+ in |
295 |
+ set new_control_params |
296 |
+ ;; |
297 |
+@@ -141,14 +144,14 @@ |
298 |
+ ;; |
299 |
+ |
300 |
+ external minor_words : unit -> int = "core_kernel_gc_minor_words" |
301 |
+-external major_words : unit -> int = "core_kernel_gc_major_words" "noalloc" |
302 |
+-external promoted_words : unit -> int = "core_kernel_gc_promoted_words" "noalloc" |
303 |
+-external minor_collections : unit -> int = "core_kernel_gc_minor_collections" "noalloc" |
304 |
+-external major_collections : unit -> int = "core_kernel_gc_major_collections" "noalloc" |
305 |
+-external heap_words : unit -> int = "core_kernel_gc_heap_words" "noalloc" |
306 |
+-external heap_chunks : unit -> int = "core_kernel_gc_heap_chunks" "noalloc" |
307 |
+-external compactions : unit -> int = "core_kernel_gc_compactions" "noalloc" |
308 |
+-external top_heap_words : unit -> int = "core_kernel_gc_top_heap_words" "noalloc" |
309 |
++external major_words : unit -> int = "core_kernel_gc_major_words" [@@noalloc] |
310 |
++external promoted_words : unit -> int = "core_kernel_gc_promoted_words" [@@noalloc] |
311 |
++external minor_collections : unit -> int = "core_kernel_gc_minor_collections" [@@noalloc] |
312 |
++external major_collections : unit -> int = "core_kernel_gc_major_collections" [@@noalloc] |
313 |
++external heap_words : unit -> int = "core_kernel_gc_heap_words" [@@noalloc] |
314 |
++external heap_chunks : unit -> int = "core_kernel_gc_heap_chunks" [@@noalloc] |
315 |
++external compactions : unit -> int = "core_kernel_gc_compactions" [@@noalloc] |
316 |
++external top_heap_words : unit -> int = "core_kernel_gc_top_heap_words" [@@noalloc] |
317 |
+ |
318 |
+ external major_plus_minor_words : unit -> int = "core_kernel_gc_major_plus_minor_words" |
319 |
+ |
320 |
+diff -uNr core_kernel-113.33.01/src/core_gc.mli core_kernel-113.33.01+4.03/src/core_gc.mli |
321 |
+--- core_kernel-113.33.01/src/core_gc.mli 2016-03-22 11:37:07.000000000 +0100 |
322 |
++++ core_kernel-113.33.01+4.03/src/core_gc.mli 2016-03-22 15:15:54.000000000 +0100 |
323 |
+@@ -148,6 +148,7 @@ |
324 |
+ first-fit policy, which can be slower in some cases but |
325 |
+ can be better for programs with fragmentation problems. |
326 |
+ Default: 0. *) |
327 |
++ window_size : int; |
328 |
+ } |
329 |
+ [@@deriving bin_io, sexp, fields] |
330 |
+ |
331 |
+@@ -185,21 +186,21 @@ |
332 |
+ (%r15 on x86-64) to the global variable [caml_young_ptr] before the C stub tries to |
333 |
+ read its value. *) |
334 |
+ external minor_words : unit -> int = "core_kernel_gc_minor_words" |
335 |
+-external major_words : unit -> int = "core_kernel_gc_major_words" "noalloc" |
336 |
+-external promoted_words : unit -> int = "core_kernel_gc_promoted_words" "noalloc" |
337 |
+-external minor_collections : unit -> int = "core_kernel_gc_minor_collections" "noalloc" |
338 |
+-external major_collections : unit -> int = "core_kernel_gc_major_collections" "noalloc" |
339 |
+-external heap_words : unit -> int = "core_kernel_gc_heap_words" "noalloc" |
340 |
+-external heap_chunks : unit -> int = "core_kernel_gc_heap_chunks" "noalloc" |
341 |
+-external compactions : unit -> int = "core_kernel_gc_compactions" "noalloc" |
342 |
+-external top_heap_words : unit -> int = "core_kernel_gc_top_heap_words" "noalloc" |
343 |
++external major_words : unit -> int = "core_kernel_gc_major_words" [@@noalloc] |
344 |
++external promoted_words : unit -> int = "core_kernel_gc_promoted_words" [@@noalloc] |
345 |
++external minor_collections : unit -> int = "core_kernel_gc_minor_collections" [@@noalloc] |
346 |
++external major_collections : unit -> int = "core_kernel_gc_major_collections" [@@noalloc] |
347 |
++external heap_words : unit -> int = "core_kernel_gc_heap_words" [@@noalloc] |
348 |
++external heap_chunks : unit -> int = "core_kernel_gc_heap_chunks" [@@noalloc] |
349 |
++external compactions : unit -> int = "core_kernel_gc_compactions" [@@noalloc] |
350 |
++external top_heap_words : unit -> int = "core_kernel_gc_top_heap_words" [@@noalloc] |
351 |
+ |
352 |
+ (** This function returns [major_words () + minor_words ()]. It exists purely for speed |
353 |
+ (one call into C rather than two). Like [major_words] and [minor_words], |
354 |
+ [major_plus_minor_words] avoids allocating a [stat] record or a float, and may |
355 |
+ overflow on 32-bit machines. |
356 |
+ |
357 |
+- This function is not marked ["noalloc"] to ensure that the allocation pointer is |
358 |
++ This function is not marked [[@@noalloc]] to ensure that the allocation pointer is |
359 |
+ up-to-date when the minor-heap measurement is made. |
360 |
+ *) |
361 |
+ external major_plus_minor_words : unit -> int = "core_kernel_gc_major_plus_minor_words" |
362 |
+@@ -256,6 +257,7 @@ |
363 |
+ -> ?max_overhead : int |
364 |
+ -> ?stack_limit : int |
365 |
+ -> ?allocation_policy : int |
366 |
++ -> ?window_size : int |
367 |
+ -> unit |
368 |
+ -> unit |
369 |
+ |
370 |
+diff -uNr core_kernel-113.33.01/src/core_gc_stubs.c core_kernel-113.33.01+4.03/src/core_gc_stubs.c |
371 |
+--- core_kernel-113.33.01/src/core_gc_stubs.c 2016-03-22 11:37:07.000000000 +0100 |
372 |
++++ core_kernel-113.33.01+4.03/src/core_gc_stubs.c 2016-03-22 15:15:54.000000000 +0100 |
373 |
+@@ -11,8 +11,8 @@ |
374 |
+ |
375 |
+ extern intnat caml_stat_minor_collections; |
376 |
+ extern intnat caml_stat_major_collections; |
377 |
+-extern intnat caml_stat_heap_size; |
378 |
+-extern intnat caml_stat_top_heap_size; |
379 |
++extern intnat caml_stat_heap_wsz; |
380 |
++extern intnat caml_stat_top_heap_wsz; |
381 |
+ extern intnat caml_stat_compactions; |
382 |
+ extern intnat caml_stat_heap_chunks; |
383 |
+ |
384 |
+@@ -54,7 +54,7 @@ |
385 |
+ |
386 |
+ CAMLprim value core_kernel_gc_heap_words(value unit __attribute__((unused))) |
387 |
+ { |
388 |
+- return Val_long(caml_stat_heap_size / sizeof (value)); |
389 |
++ return Val_long(caml_stat_heap_wsz); |
390 |
+ } |
391 |
+ |
392 |
+ CAMLprim value core_kernel_gc_heap_chunks(value unit __attribute__((unused))) |
393 |
+@@ -69,7 +69,7 @@ |
394 |
+ |
395 |
+ CAMLprim value core_kernel_gc_top_heap_words(value unit __attribute__((unused))) |
396 |
+ { |
397 |
+- return Val_long(caml_stat_top_heap_size / sizeof (value)); |
398 |
++ return Val_long(caml_stat_top_heap_wsz); |
399 |
+ } |
400 |
+ |
401 |
+ CAMLprim value core_kernel_gc_major_plus_minor_words(value unit __attribute__((unused))) |
402 |
+diff -uNr core_kernel-113.33.01/src/core_pervasives.mli core_kernel-113.33.01+4.03/src/core_pervasives.mli |
403 |
+--- core_kernel-113.33.01/src/core_pervasives.mli 2016-03-22 11:37:07.000000000 +0100 |
404 |
++++ core_kernel-113.33.01+4.03/src/core_pervasives.mli 2016-03-22 15:15:54.000000000 +0100 |
405 |
+@@ -417,8 +417,8 @@ |
406 |
+ zero. When [f] is non-zero, they are defined by |
407 |
+ [f = x *. 2 ** n] and [0.5 <= x < 1.0]. *) |
408 |
+ |
409 |
+-external ldexp : float -> int -> float = "caml_ldexp_float" |
410 |
+- [@@deprecated "[since 2014-10] Use [Float]"] |
411 |
++external ldexp : (float [@unboxed]) -> (int [@untagged]) -> (float [@unboxed]) = |
412 |
++ "caml_ldexp_float" "caml_ldexp_float_unboxed" [@@noalloc] |
413 |
+ (** [ldexp x n] returns [x *. 2 ** n]. *) |
414 |
+ |
415 |
+ external modf : float -> float * float = "caml_modf_float" |
416 |
+@@ -480,7 +480,8 @@ |
417 |
+ (** The five classes of floating-point numbers, as determined by |
418 |
+ the {!Pervasives.classify_float} function. *) |
419 |
+ |
420 |
+-external classify_float : float -> fpclass = "caml_classify_float" |
421 |
++external classify_float : (float [@unboxed]) -> fpclass = |
422 |
++ "caml_classify_float" "caml_classify_float_unboxed" [@@noalloc] |
423 |
+ [@@deprecated "[since 2014-10] Use [Float]"] |
424 |
+ (** Return the class of the given floating-point number: |
425 |
+ normal, subnormal, zero, infinite, or not a number. *) |
426 |
+@@ -953,6 +954,10 @@ |
427 |
+ Equivalent to [fun r -> r := pred !r]. *) |
428 |
+ |
429 |
+ |
430 |
++(* Result type *) |
431 |
++ |
432 |
++type ('a,'b) result = ('a, 'b) Pervasives.result = Ok of 'a | Error of 'b |
433 |
++ |
434 |
+ (** {6 Operations on format strings} *) |
435 |
+ |
436 |
+ (** Format strings are character strings with special lexical conventions |
437 |
+@@ -1054,7 +1059,6 @@ |
438 |
+ [f1], then results from [f2]. |
439 |
+ *) |
440 |
+ |
441 |
+- |
442 |
+ (** {6 Program termination} *) |
443 |
+ |
444 |
+ val exit : int -> 'a |
445 |
+diff -uNr core_kernel-113.33.01/src/core_string.ml core_kernel-113.33.01+4.03/src/core_string.ml |
446 |
+--- core_kernel-113.33.01/src/core_string.ml 2016-03-22 11:37:07.000000000 +0100 |
447 |
++++ core_kernel-113.33.01+4.03/src/core_string.ml 2016-03-22 15:15:54.000000000 +0100 |
448 |
+@@ -949,7 +949,7 @@ |
449 |
+ divergence is to expose the macro redefined in hash_stubs.c in the hash.h header of |
450 |
+ the OCaml compiler.) *) |
451 |
+ module Hash = struct |
452 |
+- external hash : string -> int = "caml_hash_string" "noalloc" |
453 |
++ external hash : string -> int = "caml_hash_string" [@@noalloc] |
454 |
+ |
455 |
+ let%test_unit _ = |
456 |
+ List.iter ~f:(fun string -> assert (hash string = Caml.Hashtbl.hash string)) |
457 |
+diff -uNr core_kernel-113.33.01/src/core_string.mli core_kernel-113.33.01+4.03/src/core_string.mli |
458 |
+--- core_kernel-113.33.01/src/core_string.mli 2016-03-22 11:37:07.000000000 +0100 |
459 |
++++ core_kernel-113.33.01+4.03/src/core_string.mli 2016-03-22 15:15:54.000000000 +0100 |
460 |
+@@ -269,7 +269,7 @@ |
461 |
+ val concat_array : ?sep : t -> t array -> t |
462 |
+ |
463 |
+ (** slightly faster hash function on strings *) |
464 |
+-external hash : t -> int = "caml_hash_string" "noalloc" |
465 |
++external hash : t -> int = "caml_hash_string" [@@noalloc] |
466 |
+ |
467 |
+ (** fast equality function on strings, doesn't use compare_val *) |
468 |
+ val equal : t -> t -> bool |
469 |
+diff -uNr core_kernel-113.33.01/src/exn.ml core_kernel-113.33.01+4.03/src/exn.ml |
470 |
+--- core_kernel-113.33.01/src/exn.ml 2016-03-22 11:37:07.000000000 +0100 |
471 |
++++ core_kernel-113.33.01+4.03/src/exn.ml 2016-03-22 15:15:54.000000000 +0100 |
472 |
+@@ -112,7 +112,8 @@ |
473 |
+ try func () with |
474 |
+ | exn -> raise (Reraised (str, exn)) |
475 |
+ |
476 |
+-external clear_backtrace : unit -> unit = "clear_caml_backtrace_pos" "noalloc" |
477 |
++external clear_backtrace : unit -> unit = "clear_caml_backtrace_pos" [@@noalloc] |
478 |
++ |
479 |
+ let raise_without_backtrace e = |
480 |
+ (* We clear the backtrace to reduce confusion, so that people don't think whatever |
481 |
+ is stored corresponds to this raise. *) |
482 |
+diff -uNr core_kernel-113.33.01/src/float.ml core_kernel-113.33.01+4.03/src/float.ml |
483 |
+--- core_kernel-113.33.01/src/float.ml 2016-03-22 11:37:07.000000000 +0100 |
484 |
++++ core_kernel-113.33.01+4.03/src/float.ml 2016-03-22 15:15:54.000000000 +0100 |
485 |
+@@ -15,7 +15,7 @@ |
486 |
+ type t = float [@@deriving sexp, bin_io, typerep] |
487 |
+ let compare (x : t) y = compare x y |
488 |
+ let equal (x : t) y = x = y |
489 |
+- external hash : float -> int = "caml_hash_double" "noalloc" |
490 |
++ external hash : float -> int = "caml_hash_double" [@@noalloc] |
491 |
+ |
492 |
+ let%test_unit _ = |
493 |
+ List.iter ~f:(fun float -> assert (hash float = Caml.Hashtbl.hash float)) |
494 |
+@@ -381,6 +381,7 @@ |
495 |
+ else |
496 |
+ invalid_argf "Float.iround_up_exn: argument (%f) is too small or NaN" (box t) () |
497 |
+ end |
498 |
++[@@ocaml.inline always] |
499 |
+ |
500 |
+ let iround_down t = |
501 |
+ if t >= 0.0 then begin |
502 |
+@@ -409,6 +410,7 @@ |
503 |
+ else |
504 |
+ invalid_argf "Float.iround_down_exn: argument (%f) is too small or NaN" (box t) () |
505 |
+ end |
506 |
++[@@ocaml.inline always] |
507 |
+ |
508 |
+ let iround_towards_zero t = |
509 |
+ if t >= iround_lbound && t <= iround_ubound then |
510 |
+@@ -481,6 +483,7 @@ |
511 |
+ else |
512 |
+ invalid_argf "Float.iround_nearest_exn: argument (%f) is too small or NaN" (box t) |
513 |
+ () |
514 |
++[@@ocaml.inline always] |
515 |
+ |
516 |
+ (* The following [iround_exn] and [iround] functions are slower than the ones above. |
517 |
+ Their equivalence to those functions is tested in the unit tests below. *) |
518 |
+diff -uNr core_kernel-113.33.01/src/heap_block.ml core_kernel-113.33.01+4.03/src/heap_block.ml |
519 |
+--- core_kernel-113.33.01/src/heap_block.ml 2016-03-22 11:37:07.000000000 +0100 |
520 |
++++ core_kernel-113.33.01+4.03/src/heap_block.ml 2016-03-22 15:15:54.000000000 +0100 |
521 |
+@@ -1,6 +1,6 @@ |
522 |
+ type 'a t = 'a [@@deriving sexp_of] |
523 |
+ |
524 |
+-external is_heap_block : Obj.t -> bool = "core_heap_block_is_heap_block" "noalloc" |
525 |
++external is_heap_block : Obj.t -> bool = "core_heap_block_is_heap_block" [@@noalloc] |
526 |
+ |
527 |
+ let is_ok v = is_heap_block (Obj.repr v) |
528 |
+ |
529 |
+diff -uNr core_kernel-113.33.01/src/int_math.ml core_kernel-113.33.01+4.03/src/int_math.ml |
530 |
+--- core_kernel-113.33.01/src/int_math.ml 2016-03-22 11:37:07.000000000 +0100 |
531 |
++++ core_kernel-113.33.01+4.03/src/int_math.ml 2016-03-22 15:15:54.000000000 +0100 |
532 |
+@@ -8,7 +8,7 @@ |
533 |
+ Core_printf.invalid_argf "integer overflow in pow" () |
534 |
+ |
535 |
+ (* To implement [int64_pow], we use C code rather than OCaml to eliminate allocation. *) |
536 |
+-external int_math_int_pow : int -> int -> int = "int_math_int_pow_stub" "noalloc" |
537 |
++external int_math_int_pow : int -> int -> int = "int_math_int_pow_stub" [@@noalloc] |
538 |
+ external int_math_int64_pow : int64 -> int64 -> int64 = "int_math_int64_pow_stub" |
539 |
+ |
540 |
+ let int_pow base exponent = |
541 |
+diff -uNr core_kernel-113.33.01/src/META core_kernel-113.33.01+4.03/src/META |
542 |
+--- core_kernel-113.33.01/src/META 2016-03-22 11:43:53.000000000 +0100 |
543 |
++++ core_kernel-113.33.01+4.03/src/META 2016-03-22 17:51:34.000000000 +0100 |
544 |
+@@ -1,6 +1,6 @@ |
545 |
+ # OASIS_START |
546 |
+-# DO NOT EDIT (digest: decb3f50ccea06803a171b5aba7b36dd) |
547 |
+-version = "113.33.01" |
548 |
++# DO NOT EDIT (digest: f5e86cbda47f50180165621f5cbe2d8d) |
549 |
++version = "113.33.01+4.03" |
550 |
+ description = "Industrial strength alternative to OCaml's standard library" |
551 |
+ requires = |
552 |
+ "bin_prot fieldslib num ppx_assert.runtime-lib ppx_bench.runtime-lib ppx_expect.collector ppx_inline_test.runtime-lib result sexplib typerep variantslib" |
553 |
+diff -uNr core_kernel-113.33.01/src/obj_array.ml core_kernel-113.33.01+4.03/src/obj_array.ml |
554 |
+--- core_kernel-113.33.01/src/obj_array.ml 2016-03-22 11:37:07.000000000 +0100 |
555 |
++++ core_kernel-113.33.01+4.03/src/obj_array.ml 2016-03-22 15:15:54.000000000 +0100 |
556 |
+@@ -33,16 +33,22 @@ |
557 |
+ |
558 |
+ let empty = [||] |
559 |
+ |
560 |
++type not_a_float = Not_a_float_0 | Not_a_float_1 of int |
561 |
++let _not_a_float_0 = Not_a_float_0 |
562 |
++let _not_a_float_1 = Not_a_float_1 42 |
563 |
++ |
564 |
+ let get t i = |
565 |
+- (* Make the compiler believe [a] is an integer array so it does not check if [a] is |
566 |
+- tagged with [Double_array_tag]. *) |
567 |
+- Obj.repr (Array.get (Obj.magic (t : t) : int array) i : int) |
568 |
++ (* Make the compiler believe [a] is an array not containing floats so it does not |
569 |
++ check if [a] is tagged with [Double_array_tag]. It is NOT ok to use "int array" |
570 |
++ since (if this function is inlined and the array contains in-heap boxed values) |
571 |
++ wrong register typing may result, leading to a failure to register necessary |
572 |
++ GC roots. *) |
573 |
++ Obj.repr (Array.get (Obj.magic (t : t) : not_a_float array) i : not_a_float) |
574 |
+ ;; |
575 |
+ |
576 |
+ let unsafe_get t i = |
577 |
+- (* Make the compiler believe [a] is an integer array so it does not check if [a] is |
578 |
+- tagged with [Double_array_tag]. *) |
579 |
+- Obj.repr (Array.unsafe_get (Obj.magic (t : t) : int array) i : int) |
580 |
++ (* See comment on [get]. *) |
581 |
++ Obj.repr (Array.unsafe_get (Obj.magic (t : t) : not_a_float array) i : not_a_float) |
582 |
+ ;; |
583 |
+ |
584 |
+ (* For [set] and [unsafe_set], if a pointer is involved, we first do a physical-equality |
585 |
+diff -uNr core_kernel-113.33.01/src/time_ns.ml core_kernel-113.33.01+4.03/src/time_ns.ml |
586 |
+--- core_kernel-113.33.01/src/time_ns.ml 2016-03-22 11:37:07.000000000 +0100 |
587 |
++++ core_kernel-113.33.01+4.03/src/time_ns.ml 2016-03-22 15:15:54.000000000 +0100 |
588 |
+@@ -419,7 +419,7 @@ |
589 |
+ |
590 |
+ #if JSC_ARCH_SIXTYFOUR |
591 |
+ external since_unix_epoch_or_zero : unit -> t |
592 |
+- = "core_kernel_time_ns_gettime_or_zero" "noalloc" |
593 |
++ = "core_kernel_time_ns_gettime_or_zero" [@@noalloc] |
594 |
+ #else |
595 |
+ external since_unix_epoch_or_zero : unit -> t |
596 |
+ = "core_kernel_time_ns_gettime_or_zero" |
597 |
+diff -uNr core_kernel-113.33.01/src/type_equal.ml core_kernel-113.33.01+4.03/src/type_equal.ml |
598 |
+--- core_kernel-113.33.01/src/type_equal.ml 2016-03-22 11:37:07.000000000 +0100 |
599 |
++++ core_kernel-113.33.01+4.03/src/type_equal.ml 2016-03-22 15:15:54.000000000 +0100 |
600 |
+@@ -64,7 +64,8 @@ |
601 |
+ type _ t = .. |
602 |
+ |
603 |
+ let sexp_of_t _sexp_of_a t = |
604 |
+- (`type_witness (Obj.extension_id t)) |> [%sexp_of: [ `type_witness of int ]] |
605 |
++ (`type_witness (Obj.extension_id (Obj.extension_constructor t))) |
606 |
++ |> [%sexp_of: [ `type_witness of int ]] |
607 |
+ ;; |
608 |
+ end |
609 |
+ |
610 |
+@@ -87,7 +88,8 @@ |
611 |
+ (module M : S with type t = t) |
612 |
+ ;; |
613 |
+ |
614 |
+- let uid (type a) (module M : S with type t = a) = Obj.extension_id M.Key |
615 |
++ let uid (type a) (module M : S with type t = a) = |
616 |
++ Obj.extension_id (Obj.extension_constructor M.Key) |
617 |
+ |
618 |
+ (* We want a constant allocated once that [same] can return whenever it gets the same |
619 |
+ witnesses. If we write the constant inside the body of [same], the native-code |