New run function based on rank2 grammars:
[SXSI/xpathcomp.git] / src / OCamlDriver.cpp
index 146a0df..7cf70c5 100644 (file)
@@ -1070,7 +1070,6 @@ extern "C" value caml_bitmap_resize(value bitmap, value nsize)
   CAMLparam2(bitmap, nsize);
   size_t bits = Long_val(nsize);
   size_t bytes = (bits / (8 * sizeof(unsigned int)) + 1 ) * sizeof(unsigned int);
-  fprintf(stderr, "Growing to: %lu bytes\n", (bits / (8 * sizeof(unsigned int)) + 1 ) * sizeof(unsigned int));
   unsigned int * buffer = (unsigned int*) realloc((void *) bitmap, bytes);
   if (buffer == NULL)
     CAMLRAISEMSG("BP: cannot reallocate memory");
@@ -1148,7 +1147,6 @@ extern "C" value caml_bp_save(value b, value file)
   int f1 = Int_val(file);
   int f2 = dup(f1);
   FILE * fd = fdopen(f2, "a");
-  fprintf(stderr, "Writing %i %p bytes\n", ((B->n+D-1)/D)*8, B );
   fflush(stderr);
   if (fd == NULL)
     CAMLRAISEMSG("Error saving bp file");
@@ -1157,3 +1155,8 @@ extern "C" value caml_bp_save(value b, value file)
   CAMLreturn(Val_unit);
 }
 
+extern "C" value caml_bp_alloc_stats(value unit)
+{
+  CAMLparam1(unit);
+  CAMLreturn (Val_long(bp_get_alloc_stats()));
+}