Interesting PRs: bringing type system legitimacy to shared allocators

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 30 14:36:52 PDT 2017


On 04/27/2017 04:04 PM, Stanislav Blinov wrote:
> On Thursday, 27 April 2017 at 19:57:52 UTC, Andrei Alexandrescu wrote:
>> https://github.com/dlang/phobos/pull/5355
>>
>> Andrei
>
> And then we'd probably need INoGCAllocator and ISharedNOGCAllocator...

"shared" is a type qualifier essentially changing the type of the 
interface, so a separate interface is needed. For @nogc, simple variance 
is sufficient:

interface A
{
     void fun();
}

class B : A
{
     void fun() @nogc {}
}

That said, there are quite a few functions we should be able to qualify 
as @nogc from the get-go, e.g. empty, expand, alignment etc. Would you 
like to try a PR to that effect? Thanks!


Andrei


More information about the Digitalmars-d mailing list