package plebeia

  1. Overview
  2. Docs

Bud hashconsing based on the hashes

type t

The cache table type

type stat = {
  1. ever_hit : int;
  2. ever_added : int;
}
val get_stat : t -> stat
val empty : unit -> t

Create a new empty table

val pp_stat : Stdlib.Format.formatter -> t -> unit

Print out the stat

val find_opt : t -> Hash.t -> Plebeia__.Index.t option
val add : t -> Hash.t -> Plebeia__.Index.t -> unit
val size : t -> int

The number of the entries in the table.

The memory used for each entry is 16words(= 128bytes) in 64bit arch.

val shrink : int -> t -> unit

Shrink down the size of the table lower than the specified number.

val reachable_words : t -> int

Count the reachable words. Very heavy. Do not use it casually.