std.allocator ready for some abuse

deadalnix deadalnix at gmail.com
Thu Oct 31 20:00:07 PDT 2013


On Friday, 1 November 2013 at 02:43:00 UTC, Andrei Alexandrescu 
wrote:
> On 10/31/13 7:26 PM, safety0ff wrote:
>> I noticed that the GCAllocator provides no way of controlling 
>> the memory
>> block attributes 
>> (http://dlang.org/phobos/core_memory.html#.GC.BlkAttr
>> ,) all allocations get the default (no attributes.) This is a 
>> leaky
>> abstraction, a data structure or composed allocators may 
>> desire to
>> control the attributes to reduce GC pressure.
>
> These attributes seem to be informed by the types stored, which 
> would be above the charter of untyped allocator.
>
> Andrei

The choice is for the typed allocator. That mean that untyped 
allocator should either provide the choice, or assume the worse 
(it may contain pointer).


More information about the Digitalmars-d mailing list