Will the GC scan this pointer?

safety0ff via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 24 05:39:47 PDT 2016


On Sunday, 24 April 2016 at 11:03:11 UTC, Lass Safin wrote:
>
> So the question is: Will the GC scan ptr? As you can see, it is 
> a write-only pointer, so reading from it will cause undefined 
> behavior (such as return data which looks like a pointer to 
> data..), and can potentially be reallly slow.

The GC will see that ptr doesn't point to memory managed by the 
GC and move on.

> Do I have to mark it with NO_SCAN each time I call 
> glMapNamedBufferRange?

No, calling setAttr on memory not managed by the GC will do 
nothing.


More information about the Digitalmars-d-learn mailing list