Skip to content

Commit

Permalink
Using new parameterized hashing function for memoization (#229)
Browse files Browse the repository at this point in the history
* Changed hasher to k_hash for memo functions.

* Simplifies cache contents for areCompatStructs

* New optimized version of the hasher
  • Loading branch information
traiansf authored and dwightguth committed Aug 22, 2016
1 parent bab4984 commit 6a83197
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions k-distribution/include/ocaml/prelude.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ type step_function = StepFunc of (k -> (k * step_function))

module KIdentityHashtbl = Hashtbl.Make(KIdentityHash)

module KMemoIdentityHash = struct
type t = k
let equal = equal_k
let hash = hash_k_param 900
end

module KMemoIdentityHashtbl = Hashtbl.Make(KMemoIdentityHash)

module GuardElt = struct
type t = Guard of int
let compare c1 c2 = match c1 with Guard(i1) -> match c2 with Guard(i2) -> i2 - i1
Expand Down

0 comments on commit 6a83197

Please sign in to comment.