Is there an object on given memory address?

Baz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 12 08:27:15 PST 2015


On Thursday, 12 February 2015 at 11:14:05 UTC, tcak wrote:
>>
>> Or send a hash of the object along with the memory address, 
>> then query the GC wether the memory is still allocated.
>
> This part sounds interesnting. How does that GC querying thing
> works exactly?

std [doc][1] is your friend but if you need guidance.
---
import core.memory : GC;
bool is_gc_allocated = addrOf(ptd) != null;
---

[1]: http://dlang.org/phobos/core_memory.html#.GC.addrOf


More information about the Digitalmars-d-learn mailing list