Module Prime_cache
Memory cache based on hash tables (prime.unstable).
val create : cache_metric:Prime_cache_metric.t -> int -> ('a, 'b) tcreate ~cache_metric ncreates a cache initially scaled for aboutnentries.- parameter cache_metric
The heuristics for when to retain a cache entry.
val clear : ('a, 'b) t -> unitclear ctremoves all cached entries fromct.
val app : ('a, 'b) t -> 'a -> 'b optionapp ck kis the cached mapping ofkif any.
val find : ('a, 'b) t -> 'a -> 'bfind ct kreturnes the object associated withk.- raises Not_found
if
khas no associated object.
val replace : ('a, 'b) t -> float -> 'a -> 'b -> unitreplace ct g k vreplaces the mapping forkwithvand associates it with a gradeg.
val remove : ('a, 'b) t -> 'a -> unitremove ct kremoves any entry cached underkfromct. Does nothing ifkis not in the cache.