Module Tnode.Weak_table

A table whose entries go with their key node (gh-ocannl-1859): what a pass records about a node lasts exactly as long as the node, however long the session, so nothing has to clear it and code holding the node keeps the record. The value may refer to the key: that keeps neither alive. Its length counts entries the GC has not swept out yet, so live_entries is what a census reads.

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val length : 'a t -> int
val stats : 'a t -> Stdlib.Hashtbl.statistics
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
val clean : 'a t -> unit
val stats_alive : 'a t -> Stdlib.Hashtbl.statistics