Anonymous avatar Anonymous committed 88bcc29

Switched to generational global root registration

Comments (0)

Files changed (2)

+2008-01-05:  Switched to generational global root registration of
+             callbacks for better performance.
+
+             Requires OCaml 3.11 or higher!!!
+
 2008-10-25:  Fixed portability problem on Mac OS X.
 
 2008-09-30:  Fixed tiny bug that prevented use with PostgreSQL 8.1.

lib/postgresql_stubs.c

 #define OPAQUEOID               2282
 #define ANYELEMENTOID           2283
 
-static value v_empty_string = 0;
+static value v_empty_string = Val_unit;
 static value v_None = Val_int(0);
 
 static inline value make_some(value v)
 
 CAMLprim value PQocaml_init(value __unused v_unit)
 {
-  caml_register_global_root(&v_empty_string);
   v_empty_string = caml_alloc_string(0);
+  caml_register_generational_global_root(&v_empty_string);
   v_exc_Oid = caml_named_value("Postgresql.Oid");
   return Val_unit;
 }
   c = (np_callback *) caml_stat_alloc(sizeof(np_callback));
   c->v_cb = v_handler;
   c->cnt = 1;
-  caml_register_global_root(&(c->v_cb));
+  caml_register_generational_global_root(&(c->v_cb));
   return c;
 }
 
   if (c) {
     c->cnt--;
     if (c->cnt == 0) {
-      caml_remove_global_root(&c->v_cb);
+      caml_remove_generational_global_root(&c->v_cb);
       caml_stat_free(c);
     }
   }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.