Garbage collected pointers?

Gary Willoughby dev at nomad.so
Fri Mar 2 08:44:53 UTC 2018


On Thursday, 1 March 2018 at 12:20:08 UTC, Steven Schveighoffer 
wrote:
> On 3/1/18 7:05 AM, Gary Willoughby wrote:
>> On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote:
>>> My question is how do I tell if a pointer is "garbage 
>>> collected" or not?
>> 
>> You could try `GC.addrOf()` or `GC.query()` in core.memory.
>
> I was going to say this, but then I realized, it's not that the 
> pointer points at GC-allocated memory, but that the pointer 
> itself is stored in a location that is scanned by the GC. 
> That's not as easy to figure out, as you have to look at 
> stacks, added ranges, etc.
>
> -Steve

It would be interesting to test whether those methods handle 
these scenarios.



More information about the Digitalmars-d-learn mailing list