10 val equal : t -> t -> bool
11 val stats : unit -> unit
12 val init : unit -> unit
19 type t = private { id : Uid.t;
26 val equal : t -> t -> bool
27 val stats : unit -> unit
28 val init : unit -> unit
31 module Make (H : Hashtbl.HashedType) : S with type data = H.t =
33 let uid_make,uid_current,uid_set = Uid.make_maker()
35 type t = { id : Uid.t;
41 let equal t1 t2 = t1 == t2
42 module WH = Weak.Make( struct
46 let equal a b = a == b || H.equal a.node b.node
48 let pool = WH.create MED_H_SIZE
50 exception Found of Uid.t
51 let total_count = ref 0
52 let miss_count = ref 0
59 let cell = { id = Uid.dummy; key = H.hash x; node = x } in
64 let cell = { cell with id = uid_make(); } in
72 Logger.print Format.err_formatter "Hconsing statistics: %i/%i = %f@\n"
75 ((float_of_int !miss_count) /. (float_of_int !total_count))
76 (* let l = WH.fold (fun cell acc -> (Uid.to_int cell.id)::acc) pool [] in
77 let l = List.sort compare l in
78 Logger.print Format.err_formatter "Hconsing statistics:@\n%a"
80 Pretty.pp_print_list ~sep:Format.pp_force_newline Format.pp_print_int ppf l) l *)