UDA and trait for non-GC managed pointers

Nordlöw via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 16 01:57:52 PDT 2016


On Sunday, 16 October 2016 at 04:14:42 UTC, Chris Wright wrote:
> On Sat, 15 Oct 2016 16:22:35 +0000, Nordlöw wrote:
>
>> Is there a way to check if a pointer is supposed to point to 
>> non-GC allocated memory?
>
> You can check if it *does* point to GC-allocated memory if you 
> use GC internals -- the Pool struct is what you want to look 
> at, and the lookup methods associated with it.

That's in run-time, though. I want it in compile-time so we can 
optimize away calls to GC.{add,Remove}Range. And that we don't 
have yet.

Thanks anyway.


More information about the Digitalmars-d mailing list