Module Hc.Mk_thread_safeSource

Hash-consing module using a custom user-defined cache. Thread-safe.

Parameters

module Cache : Cache

Signature

Sourcetype key = Cache.key

The type of value that are being hash-consed.

Sourceval clear : unit -> unit

Removes all elements from the table.

Sourceval hashcons : key -> key hash_consed

hashcons v hash-cons the value v, i.e. returns any existing value equal to v that has already been hash-consed, if any; otherwise, allocates a new hash-consed value with v as a node and returns it. As a consequence the returned value is physically equal to any equal value already hash-consed.

Sourceval stats : unit -> Hashtbl.statistics

Return statistics about the hash-consing table.

Sourceval length : unit -> int

The number of hash-consed values.