Blob Blame Raw
--- ./cil/ocamlutil/inthash.ml.orig	2011-10-10 02:40:09.000000000 -0600
+++ ./cil/ocamlutil/inthash.ml	2012-08-27 15:09:37.694716225 -0600
@@ -61,6 +61,12 @@ let clear h =
   done;
   h.size <- 0
 
+let reset h =
+  for i = 0 to Array.length h.data - 1 do
+    h.data.(i) <- Empty
+  done;
+  h.size <- 0
+
 let copy h =
   { size = h.size;
     data = Array.copy h.data }
@@ -228,3 +234,7 @@ let memoize (h: 'a t) (key: int) (f: int
   
 let tolist (h: 'a t) : (int * 'a) list = 
   fold (fun k d acc -> (k, d) :: acc) h []
+
+let stats h = 
+  { Hashtbl.num_bindings = h.size; Hashtbl.num_buckets = Array.length h.data;
+    Hashtbl.max_bucket_length = 1; Hashtbl.bucket_histogram = Array.make 2 0 }
--- ./cil/ocamlutil/inthash.mli.orig	2011-10-10 02:40:09.000000000 -0600
+++ ./cil/ocamlutil/inthash.mli	2012-08-27 14:54:00.594502979 -0600
@@ -50,6 +50,7 @@ type 'a t
 
 val create: int -> 'a t
 val clear: 'a t -> unit
+val reset: 'a t -> unit
 val length : 'a t -> int
 
 val copy: 'a t -> 'a t
@@ -67,6 +68,8 @@ val find_all: 'a t -> int -> 'a list
 val iter: (int -> 'a -> unit) -> 'a t -> unit
 val fold: (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
 
+val stats: 'a t -> Hashtbl.statistics
+
 val memoize: 'a t -> int -> (int -> 'a) -> 'a
 
 val tolist: 'a t -> (int * 'a) list