GCAllocator goodAllocSize?

Jakob Ovrum via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 1 21:07:23 PST 2016


On Tuesday, 2 February 2016 at 05:04:00 UTC, Jakob Ovrum wrote:
> On Sunday, 31 January 2016 at 18:52:48 UTC, Steven 
> Schveighoffer wrote:
>> 2. How does one allocate with an allocator for typed info? In 
>> other words, the GC will call the dtor, but only if it knows 
>> what type you put in there. With std.experimental.allocator, 
>> there isn't a way to do that.
>
> std.allocator.{make, dispose} is the type-aware interface. They 
> don't currently do anything with regards to GC, and I don't 
> think they really can except for the simplest case where A is 
> exactly GCAllocator. If GCAllocator is part of an allocator 
> composition or hidden behind IAllocator I don't think `make` 
> can do anything about it.
>
> Maybe GCAllocator simply isn't that useful.

The issue of scanning is course also an issue when references to 
GC memory are stowed away in non-GC memory allocated with the 
standard allocator interface.


More information about the Digitalmars-d mailing list