package hc

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module HcSource

Hash-consing library.

The implementation is based on the paper Type-Safe Modular Hash-Consing by Jean-Christophe-Filliâtre and Sylvain Conchon.

Sourcetype +'a hash_consed = private {
  1. node : 'a;
  2. tag : int;
}

The type of hash-consed values. The node field is the actual value and tag is a unique integer identifier.

Sourcemodule type S = sig ... end

The output signature of the various functors Make, MakeStrong, Fake and Mk.

Sourcemodule Make (H : Hashtbl.HashedType) : S with type key = H.t

Hash-consing module using Ephemeron.K1.Make as a back-end cache.

Sourcemodule MakeStrong (H : Hashtbl.HashedType) : S with type key = H.t

Hash-consing module using Hashtbl.Make as a back-end cache.

Sourcemodule Fake (H : Hashtbl.HashedType) : S with type key = H.t

Hash-consing module that does not perform hash-consing. This is useful to easily benchmark the impact of hash-consing without having to change your code too much: simply replace Make or Makestrong by Fake.

Sourceval get_initial_cache_size : unit -> int

The size that will be used to create a cache.

Sourceval set_initial_cache_size : int -> unit

Change the size that will be used to create a cache.

Sourceval reset_initial_cache_size : unit -> unit

Reset the size that will be used to create a cache to its default value.

Sourcemodule type Cache = sig ... end

The type of custom cache modules.

Sourcemodule Mk (Cache : Cache) : S with type key = Cache.key

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

OCaml

Innovation. Community. Security.