Skip to content

Commit beed79b

Browse files
committed
fixup! [Stdlib] Ephemeron: add the module in the stdlib
1 parent 178c475 commit beed79b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

stdlib/ephemeron.mli

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
keys is not considered alive anymore by the GC, the data is
3333
emptied from the ephemeron even if the data is alive for another
3434
reason.
35+
36+
The ephemerons complicate the notion of liveness of values, because
37+
it is not anymore an equivalence with the reachability from root
38+
value by usual pointers (not weak and not ephemerons). The notion
39+
of liveness is constructed by the least fixpoint of:
40+
A value is alive if:
41+
- it is a root value
42+
- it is reachable from alive value by usual pointers
43+
- it is the data of an ephemeron with all its full keys alive
44+
3545
*)
3646

3747
module type S = sig
@@ -40,6 +50,9 @@ module type S = sig
4050
(** same as {!Hashtbl.SeededS.stats} but only count the alive bindings *)
4151
end
4252
(** The output signature of the functor {!K1.Make} and {!K2.Make}.
53+
These hashtables are weak in the keys. If all the keys of a binding are
54+
alive the binding is kept, but if one of the keys of the binding
55+
is dead then the binding is removed.
4356
*)
4457

4558
module type SeededS = sig

0 commit comments

Comments
 (0)