Interesting PRs: bringing type system legitimacy to shared allocators

Stanislav Blinov via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 27 16:35:39 PDT 2017


On Thursday, 27 April 2017 at 23:12:48 UTC, Moritz Maxeiner wrote:
> On Thursday, 27 April 2017 at 20:04:32 UTC, 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...
>
> Wasn't one major selling point of compile time introspection / 
> duck typing that we could stop using interfaces such... naming 
> schemes?

IAllocator is too high level an interface, it doesn't carry any 
information as to what type of memory it can allocate (so we can 
only assume unshared), and does or does it not use GC (so we can 
only assume GC).

If we are to devise types with allocators as members instead of 
type arguments, we need the additional information. Better to 
catch invalid assignment at compile time than to chase down how a 
stack allocator from one thread ended up in another.


More information about the Digitalmars-d mailing list