static void arrays under garbage control?

captaindet via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 26 08:57:58 PST 2015


On 2015-02-26 10:07, Steven Schveighoffer wrote:
> Static data I believe is always scanned conservatively because no
> type information is stored for it ever, even on allocation (i.e.
> program startup).  

ouh, the confusion goes on... are you saying that

{
     // will be all scanned by GC for
     // potential pointers into GC managed memory:
     void[16] buffer0 = void;
     ubyte[16] buffer1;
     uint[4] buffer3;
     
     // will not be scanned by GC for pointers:
     void[] buffer4 = cast(void[])(new ubyte[16]);
     uint[] buffer5 = cast(uint[])(new ubyte[16]);
}



More information about the Digitalmars-d-learn mailing list