Am Freitag, den 24.02.2017, 10:38 +0000 schrieb Richard W.M. Jones: > (2) We have lots of existing code which does: > >   CAMLlocal1 (v); >   // some code here which might allocate and call the GC >   v = ... > > It's my understanding that such code might crash with the older > versions of OCaml, because when it calls the GC it will find a local > root which is initialized to 0.  We want to continue to support the > older versions (back to 3.12 in fact), so should we change it all to: > >   CAMLlocal1 (v); v = Val_unit; >   // some code here which might allocate and call the GC >   v = ... > > ?  Interestingly none of this code has actually crashed in production > as far as I'm aware. Because it is correct for older OCaml versions - which do not follow pointers that are not allocated by OCaml. Note that this is still the default, but you can now change it with the -no-naked-pointers configure switch, in which case such pointers lead to a crash when they are run into by the GC (well, I'm not sure about a null pointers, though). The -no-naked-pointers switch accelerates in particular assignments (caml_darken called via caml_modify). Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------