plebeia

Merkle Patricia tree implementation
Library plebeia
type t

The cache table type

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

Create a new empty table

val pp_stat : 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.