[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Christophe Raffalli <christophe.raffalli@u...> |
| Subject: | GC and map |
Hello,
I would like to implement the feature described bellow ... I think this is impossible in the current
state of OCaml, but I may be wrong, so if someone can help ...
'a map is the type of a functional map from int to 'a (I do not care about the internal
representation, except that performance would matter a little too)
set is the type for set of int (here again representation do no matter that much)
All maps can only appear in structure of type
environment = { accessible_keys : set; map : 'a map }
(this is possible to enforce with abstract type)
Then I would like the GC to behave like this :
Let m be of type 'a map and alive. Assume it appears only in the following alive environment
{ accessible_keys = a1; map = m }
{ accessible_keys = a2; map = m }
...
{ accessible_keys = an; map = m }
Then, I would like the GC to remove all bindings in m for integers not present in a1 ... an.
It would even be better if values associated to these bindings where not even scanned by the GC, but
I think this is much more difficult.
Any Idea (purely in OCaml or in C) ?
This would be possible in C if in the "struct custom_operations" there was a "scan" function to scan
values inside an allocated custom block. This function would be very similar to the serialize
function ... Anyway I would prefer a pure OCaml solution.
--
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex
tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
---------------------------------------------
IMPORTANT: this mail is signed using PGP/MIME
At least Enigmail/Mozilla, mutt or evolution
can check this signature. The public key is
stored on www.keyserver.net
---------------------------------------------