An important pull request: accessing shared affix for immutable data
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Sat Feb 13 10:16:43 PST 2016
On 13.02.2016 18:42, Andrei Alexandrescu wrote:
> On 02/13/2016 11:55 AM, Timon Gehr wrote:
>> If you alias the same data as both shared and unshared, the shared
>> version can be sent to another thread which will then modify it,
>> violating the guarantees on the unshared reference.
>
> Oh, I understand. So you're thinking of someone taking the address of
> allocator.prefix(block) and sharing it across threads? -- Andrei
Not necessarily. shared is transitive and prefix/suffix are arbitrary
types which might contain mutable indirections.
I don't really see why this part of the allocator interface should even
be typed.
More information about the Digitalmars-d
mailing list