3 ms·
I wonder if Haskell has a way to (optionally of course) put objects into manually allocated memory regions? I implemented this in 2006 for OCaml[1]. We used i
by rwmj 7y ago
I wonder if Haskell has a way to (optionally of course) put objects into manually allocated memory regions? I implemented this in 2006 for OCaml[1]. We used it for (what we would nowadays call) "big data" processing where we had a huge amount of static data for analysis and we didn't want the GC to be constantly traversing it. We could move this data into the manually allocated region we called the "ancient heap". It still appeared as regular OCaml objects, but when the GC saw a pointer that crossed into the ancient heap it would stop following it.
Of course the obvious down side is you have to remember to manually deallocate it :-)
[1] https://opam.ocaml.org/packages/ancient/ https://opam.ocaml.org/packages/ancient/
- arianvanp 7y agoThis is exactly what the article is describing no? This sounds like the "compact regions" feature the entire article is about.
- rwmj 7y agoOh I see - on first reading I thought that compact regions were separately GC'd regions in the old generation. Skimming the paper (http://ezyang.com/papers/ezyang15-cnf.pdf http://ezyang.com/papers/ezyang15-cnf.pdf) it does seem as if they independently rediscovered ocaml-ancient.