Understanding GC memory ranges and roots

Per Nordlöw per.nordlow at gmail.com
Mon Jul 6 23:03:36 UTC 2020


I'm experimenting with an alternative GC implementation at

https://github.com/nordlow/phobos-next/blob/master/benchmarks/gc-benchmark/source/segregated_gc.d

I now wonder if the parameters passed by `GC.addRange` and 
`GC.addRoot` are the only memory entry blocks I need to implement 
to correctly scan the stack and static memory storage?

I doesn't seem like that because when I add prints to these 
functions the only call I get is

addRange(0x556d8d118ea0, 93200, nil)

Is this the stack or the static storage?
I'm guessing static storage because printing the address of the 
first variable in a function prints 0x7ffe094fa014 which is very 
different from 0x556d8d118ea0.

How do I catch both the stack and static storage?

And why am I not getting any calls to GC.addRoot()? When is 
GC.addRoot() supposed to be called and by who?



More information about the Digitalmars-d mailing list