Interesting PRs: bringing type system legitimacy to shared allocators

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 30 21:54:28 PDT 2017


On 4/30/17 8:43 PM, Stanislav Blinov wrote:
> On Sunday, 30 April 2017 at 21:43:26 UTC, Andrei Alexandrescu wrote:
>> On 04/27/2017 07:35 PM, Stanislav Blinov wrote:
>>> 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).
>>
>> Initially all fresh memory is unshared. Whether or not the user 
>> subsequently shares it is of no consequence to the allocator.
> 
> Why would we need any ISharedAllocator then?

The allocator itself may be shared across threads, in which case its 
primitives need to be reentrant. -- Andrei


More information about the Digitalmars-d mailing list