-let create s ss = { id = next ();
- states = s;
- selection_states = ss;
- transitions = Hashtbl.create 17;
- cache2 = Cache.N2.create dummy2;
- cache6 = Cache.N6.create dummy6;
- }
+let create s ss =
+ let auto = { id = next ();
+ states = s;
+ selection_states = ss;
+ transitions = Hashtbl.create 17;
+ cache2 = Cache.N2.create dummy2;
+ cache6 = Cache.N6.create dummy6;
+ }
+ in
+ at_exit (fun () ->
+ let n6 = ref 0 in
+ let n2 = ref 0 in
+ Cache.N2.iteri (fun _ _ _ b -> if b then incr n2) auto.cache2;
+ Cache.N6.iteri (fun _ _ _ _ _ _ _ b -> if b then incr n6) auto.cache6;
+ Format.eprintf "INFO: automaton %i, cache2: %i entries, cache6: %i entries\n%!"
+ (auto.id :> int) !n2 !n6
+ );
+ auto