Knowledge of managed memory pointers

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 07:59:14 PDT 2014


On Thu, 17 Apr 2014 10:52:19 -0400, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 04/17/2014 08:55 AM, Manu via Digitalmars-d wrote:

>> If an API
>> could be provided in druntime, it may be used by GC's, ARC, allocators,
>> or systems that operate at the barrier between languages.
>>
>
> There already is.
>
> bool isGCPointer(void* ptr){
>      import core.memory;
>      return !!GC.addrOf(ptr);
> }

I don't think this is a viable mechanism to check pointers. It's too slow.

-Steve


More information about the Digitalmars-d mailing list