On 02/26/2015 10:07 AM, Steven Schveighoffer wrote:

>>      // will not be scanned by GC for pointers:
>>      void[] buffer4 = cast(void[])(new ubyte[16]);
>>      uint[] buffer5 = cast(uint[])(new ubyte[16]);
>
> Correct, since they are allocated as ubyte[]. uint[] also would not be
> scanned.

I've been under the impression that current GC being imprecise, even an unfortunate bit-pattern in an int would keep otherwise dead objects alive. Is that still true for a single int?

And is 'new int[N]' better in this regard because it never keeps objects alive?

Ali

Reply via email to