+ let line = if line == h.default_line then
+ let l = Array.copy line in Array.unsafe_set h.table idx l;l
+ else line in
+ let line = if tag >= Array.length line then
+ let new_line = realloc line (next_power_of_2 tag) h.default_elm in
+ let _ = Array.unsafe_set h.table idx new_line in new_line
+ else line
+ in
+ Array.unsafe_set line tag data
+
+
+ let dump h = Array.iteri
+ (fun id line -> if line != h.default_line then
+ begin
+ StateSet.print Format.err_formatter (StateSet.with_id (Uid.of_int id));
+ Format.fprintf Format.err_formatter " -> ";
+ Array.iteri (fun tag clos ->
+ if clos != h.default_elm then
+ Format.fprintf Format.err_formatter " (%s,%s) "
+ (Tag.to_string tag) (Trace.get_funname clos)) line;
+ Format.fprintf Format.err_formatter "\n%!"
+ end
+ ) h.table;
+ Format.fprintf Format.err_formatter "Cache hits: %i, Cache misses: %i, ratio = %f\n%!"
+ h.access h.miss ((float_of_int h.miss)/. (float_of_int h.access));
+ Format.fprintf Format.err_formatter "Size: %i kb\n%!"
+ (((2+(Array.length h.default_line)+
+ (Array.fold_left (fun acc l ->acc + (if l == h.default_line then 0 else Array.length l))
+ (Array.length h.table) h.table)) * Sys.word_size) / 1024)