|Anonymous | Login | Signup for a new account||2018-01-24 07:07 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006353||OCaml||runtime system and C interface||public||2014-03-26 22:38||2016-01-27 09:24|
|Priority||normal||Severity||feature||Reproducibility||have not tried|
|Target Version||4.03.0+dev / +beta1||Fixed in Version|
|Summary||0006353: [github patch] Ephemerons|
|Description||Discussion and description at:|
The current OCaml runtime proposes two kinds of pointers:
A points hardly to B: if A is alive, B is alive (usual pointers)
A points weakly to B: when the GC decide that B stops to be alive, A stops to point to B
Weak pointers are very handy when you want to be able to access a data without creating memory leaks. For example hashconsing can be done using the weaksets defined in Weak.Make. However you can't create general weaktable with the current runtime: associative table that keep a data until the key is not needed anymore. The problematic case is when the data points to the key.
Barry Hayes proposed in 1997 the notion of ephemerons which allow to code such table. In its simplest form an ephemeron A with key K and data D keeps D alive while A and K are alive. To sum up ephemerons add the possibility to express conjunctions where you normally have only disjunctions.
Request for Comment and Merge-Request
This merge-request adds ephemerons to ocaml with particularly a modification of the runtime, and a new module in the standard library. An untyped API with an arbitrary number of keys is given in Ephemerons.Obj and two specialized API for one and two keys are provided in Ephemerons.K1 and Ephemerons.K2. Each of these three APIs define a functor for constructing weaktables with the same signature than Hashtbl.
|Tags||No tags attached.|
Ephemerons missed the feature deadline for 4.02 because of license issues but I hope they'll be included for 4.03.
|Closing this ticket. The progress is tracked on the Github PR.|
|2014-03-26 22:38||gasche||New Issue|
|2014-07-16 15:35||doligez||Note Added: 0011847|
|2014-07-16 15:35||doligez||Status||new => confirmed|
|2014-07-16 15:35||doligez||Target Version||=> 4.03.0+dev / +beta1|
|2016-01-27 09:23||frisch||Note Added: 0015275|
|2016-01-27 09:23||frisch||Status||confirmed => closed|
|2016-01-27 09:24||frisch||Resolution||open => duplicate|
|2017-02-23 16:43||doligez||Category||OCaml runtime system => runtime system|
|2017-03-03 17:45||doligez||Category||runtime system => runtime system and C interface|
|Copyright © 2000 - 2011 MantisBT Group|