diff --git a/README b/README index 8c7490143..19a1fb2f2 100644 --- a/README +++ b/README @@ -84,7 +84,7 @@ The full requirements are described below. +--------------+-------------+---+-----------------------------------------+ | Pod::Simple | | R | Part of Perl core. | +--------------+-------------+---+-----------------------------------------+ -| OCaml | |R/O| Required if compiling from git. | +| OCaml | 3.11 |R/O| Required if compiling from git. | | | | | Optional if compiling from tarball. | | | | | To build generated files and OCaml bindings. +--------------+-------------+---+-----------------------------------------+ diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c index cbff84684..1ee5ba701 100644 --- a/ocaml/guestfs-c.c +++ b/ocaml/guestfs-c.c @@ -88,12 +88,12 @@ guestfs_finalize (value gv) /* Now unregister the global roots. */ for (i = 0; i < len; ++i) { - caml_remove_global_root (roots[i]); + caml_remove_generational_global_root (roots[i]); free (roots[i]); } free (roots); - caml_remove_global_root (v); + caml_remove_generational_global_root (v); free (v); } } @@ -179,10 +179,7 @@ ocaml_guestfs_create (value environmentv, value close_on_exitv, value unitv) */ v = guestfs_int_safe_malloc (g, sizeof *v); *v = gv; - /* XXX This global root is generational, but we cannot rely on every - * user having the OCaml 3.11 version which supports this. - */ - caml_register_global_root (v); + caml_register_generational_global_root (v); guestfs_set_private (g, "_ocaml_g", v); CAMLreturn (gv); @@ -255,10 +252,7 @@ ocaml_guestfs_set_event_callback (value gv, value closure, value events) ocaml_guestfs_raise_error (g, "set_event_callback"); } - /* XXX This global root is generational, but we cannot rely on every - * user having the OCaml 3.11 version which supports this. - */ - caml_register_global_root (root); + caml_register_generational_global_root (root); snprintf (key, sizeof key, "_ocaml_event_%d", eh); guestfs_set_private (g, key, root); @@ -280,7 +274,7 @@ ocaml_guestfs_delete_event_callback (value gv, value ehv) value *root = guestfs_get_private (g, key); if (root) { - caml_remove_global_root (root); + caml_remove_generational_global_root (root); free (root); guestfs_set_private (g, key, NULL); guestfs_delete_event_callback (g, eh);