Variables should have the ability to be @nogc

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 16:46:59 PDT 2016


Am Tue, 31 May 2016 20:41:09 +0000
schrieb Basile B. <b2.temp at gmx.com>:

> The only thing is that I'm not sure about is the tri-state and 
> the recursion. I cannot find a case where it would be justified.

The recursion is simply there to find pointers in nested
structs and their GcScan annotations:

// A does not need scanning
struct A
{
    B b;
}

struct B
{
    @noScan void* p;
}

The tri-state may not be necessary, I don't remember my
rationale there. I do use GcScan.automatic as the default in
memory allocation for example with the option to force it to
yes or no. It gives you more control, just in case.

-- 
Marco



More information about the Digitalmars-d mailing list