Add function to query the memory usage of the BP structure.
authorKim Nguyễn <kn@lri.fr>
Wed, 22 Feb 2012 16:53:34 +0000 (17:53 +0100)
committerKim Nguyễn <kn@lri.fr>
Wed, 22 Feb 2012 16:53:34 +0000 (17:53 +0100)
src/OCamlDriver.cpp
src/bp.ml
src/bp.mli

index ab145ec..7cf70c5 100644 (file)
@@ -1155,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()));
+}
index e230931..7dc4b49 100644 (file)
--- a/src/bp.ml
+++ b/src/bp.ml
@@ -30,6 +30,7 @@ let bitmap_push_back b i =
 
 type t
 external bp_construct : cbitmap -> int -> t = "caml_bp_construct"
+external alloc_stats : unit -> int = "caml_bp_alloc_stats"
 external save : t -> Unix.file_descr -> unit = "caml_bp_save"
 external load : Unix.file_descr -> t = "caml_bp_load"
 external first_child : t -> int -> int = "caml_bp_first_child" "noalloc"
index 7053493..55e5723 100644 (file)
@@ -13,3 +13,4 @@ external first_child : t -> int -> int = "caml_bp_first_child" "noalloc"
 external next_sibling : t -> int -> int = "caml_bp_next_sibling" "noalloc"
 external preorder_rank : t -> int -> int = "caml_bp_preorder_rank" "noalloc"
 
+val alloc_stats : unit -> int