Will the GC scan this pointer?

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 24 05:20:41 PDT 2016


On 24.04.2016 13:03, Lass Safin wrote:
> // Omitting the required imports.
>
> void[] ptr;
>
> void main() {
>      uint buffer;
>      glCreateBuffers(1, &buffer);
>      // Filling the buffer with data and such...
>      ptr = glMapNamedBufferRange(buffer, 0, 512, GL_MAP_WRITE_BIT |
> GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT)[0 .. 512];
> }
>
> So the question is: Will the GC scan ptr?
[...]
> Do I have to mark it with NO_SCAN each time I call glMapNamedBufferRange?

I don't think so. The GC generally doesn't care about heap memory that's 
not been allocated through it. As I understand it, you'd have to state 
explicitly that that memory should be scanned.


More information about the Digitalmars-d-learn mailing list