Created
November 21, 2018 09:51
-
-
Save Gbury/a2980420c64a1465c977651a3e76120b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WI = Weak.Make( | |
struct | |
type t = int | |
let hash i = i | |
let equal i j = i = j | |
end) | |
let wi = WI.create 17 | |
let f () = | |
let len, nb_entries, sum_buck_len, min_len, med_len, max_len = WI.stats wi in | |
let pp = Format.eprintf in | |
pp "len = %d\n" len; | |
pp "nb_entries = %d\n" nb_entries; | |
pp "sum_buck_len = %d\n" sum_buck_len; | |
pp "min_buck_len = %d\n" min_len; | |
pp "med_buck_len = %d\n" med_len; | |
pp "max_buck_len = %d\n" max_len; | |
pp "--------------------------@." | |
let () = | |
f (); | |
let a = WI.merge wi 1 in | |
f () | |
(* Results : | |
len = 17 | |
nb_entries = 0 | |
sum_buck_len = 0 | |
min_buck_len = 0 | |
med_buck_len = 0 | |
max_buck_len = 0 | |
-------------------------- | |
len = 17 | |
nb_entries = 1 | |
sum_buck_len = 3 | |
min_buck_len = 0 | |
med_buck_len = 0 | |
max_buck_len = 3 | |
-------------------------- | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment