The GC (agian)

bauss jj_1337 at live.dk
Tue Nov 23 07:14:17 UTC 2021


On Sunday, 21 November 2021 at 09:29:10 UTC, Imperatorn wrote:
>
> I get the feeling that maybe what's missing is just confidence 
> in the system. Are there good documentation about this for 
> example? Some walk through? Videos with evidence that the GC is 
> not touching @nogc etc?
>

The GC will never touch @nogc because @nogc will have the 
compiler verify that any operation you do in such scope doesn't 
allocate using the GC.

Which means the GC has no idea allocated memory in the scope 
actually exist.

The GC doesn't work by scanning memory and figuring out whether a 
block of memory is GC allocated or not.

The GC works by having a set of nodes that it scans through and 
checks whether they have any references pointing to them.

All nodes of course refer to GC allocations. Ex. when you 
allocate memory for a class then a node for said class will be 
added to the GC and scanned.



More information about the Digitalmars-d mailing list