On heap segregation, GC optimization and @nogc relaxing

via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 14 14:36:33 PST 2014


On Friday, 14 November 2014 at 21:59:47 UTC, deadalnix wrote:
> That is a well covered subject and told you what to google for 
> as
> well as the basic approach. Your example here simply told me you
> haven't done your homework before posting.
>
> Please go look into scientific documentation about GC for ML
> languages.

It would help if you post links to articles.

ML is geared towards functional programming which have different 
behaviour from system level imperative programming, so I am not 
sure if ML is the best starting point.

 From https://ocaml.org/learn/tutorials/garbage_collection.html :

«OCaml's garbage collector has two heaps, the minor heap and the 
major heap. This recognises a general principle: Most objects are 
small and allocated frequently and then immediately freed. These 
objects go into the minor heap first, which is GCed frequently. 
Only some objects are long lasting. These objects get promoted 
from the minor heap to the major heap after some time, and the 
major heap is only collected infrequently.

The OCaml GC is synchronous. It doesn't run in a separate thread, 
and it can only get called during an allocation request.»

Nothing about segregation here. The older MLkit which uses a 
regional allocator is interesting, but probably not what you are 
talking about.



More information about the Digitalmars-d mailing list