Skip to content

Commit

Permalink
Remove some workarounds not needed with batteries >=3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Dec 1, 2023
1 parent db49fe9 commit 8104b3e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/framework/cfgTools.ml
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ let createCFG (file: file) =
);
if Messages.tracing then Messages.trace "cfg" "CFG building finished.\n\n";
if get_bool "dbg.verbose" then
ignore (Pretty.eprintf "cfgF (%a), cfgB (%a)\n" GobHashtbl.pretty_statistics (GobHashtbl.magic_stats cfgF) GobHashtbl.pretty_statistics (GobHashtbl.magic_stats cfgB));
ignore (Pretty.eprintf "cfgF (%a), cfgB (%a)\n" GobHashtbl.pretty_statistics (NH.stats cfgF) GobHashtbl.pretty_statistics (NH.stats cfgB));
cfgF, cfgB, skippedByEdge

let createCFG = Timing.wrap "createCFG" createCFG
Expand Down
8 changes: 1 addition & 7 deletions src/solvers/postSolver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@ struct

module VH = Hashtbl.Make (S.Var)
(* starts as Hashtbl for quick lookup *)
let starth =
(* VH.of_list S.starts *) (* TODO: BatHashtbl.Make.of_list is broken, use after new Batteries release *)
let starth = VH.create (List.length S.starts) in
List.iter (fun (x, d) ->
VH.replace starth x d
) S.starts;
starth
let starth = VH.of_list S.starts

let system x =
match S.system x, VH.find_option starth x with
Expand Down
4 changes: 0 additions & 4 deletions src/util/std/gobHashtbl.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module Pretty = GoblintCil.Pretty

let magic_stats h =
let h: _ Hashtbl.t = Obj.magic h in (* Batteries Hashtables don't expose stats yet...: https://github.com/ocaml-batteries-team/batteries-included/pull/1079 *)
Hashtbl.stats h

let pretty_statistics () (s: Hashtbl.statistics) =
let load_factor = float_of_int s.num_bindings /. float_of_int s.num_buckets in
Pretty.dprintf "bindings=%d buckets=%d max_length=%d histo=%a load=%f" s.num_bindings s.num_buckets s.max_bucket_length (Pretty.docList (Pretty.dprintf "%d")) (Array.to_list s.bucket_histogram) load_factor

0 comments on commit 8104b3e

Please sign in to comment.