RFC: moving forward with @nogc Phobos

Shammah Chancellor via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 29 17:01:28 PDT 2014


On 2014-09-29 22:15:33 +0000, Andrei Alexandrescu said:

> On 9/29/14, 11:44 AM, Shammah Chancellor wrote:
>> I don't like the idea of having to pass in template parameters
>> everywhere -- even for allocators.
> 
> I agree.
> 
>> Is there some way we could have
>> "allocator contexts"?
>> 
>> E.G.
>> 
>> with( auto allocator = ReferencedCounted() )
> 
> Don't confuse memory allocation with memory management. There's no such 
> a thing as a "reference counted allocator".
> 
> Andrei

Sure, but combining the two could be very useful -- as we have noticed 
with a allocators that work off of a garbage collector.  With regards 
to reference counting, you could implement one that automatically wraps 
the type in an RC struct and proxies them.   Being able to redefined 
aliases during different sections of compilation would be required 
though.



More information about the Digitalmars-d mailing list