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