An important pull request: accessing shared affix for immutable data

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 12 19:10:34 PST 2016


On Saturday, 13 February 2016 at 03:05:08 UTC, Andrei 
Alexandrescu wrote:
>> I was actually suggesting encoding the shared-ness into the 
>> memory
>> address itself. (No tricks - just allocate shared data in a 
>> separate
>> memory range. This may only be feasible on 64-bit though, with 
>> its
>> over-abundance of address space.)
>>
>> This way, you can determine whether the (meta-)data is shared 
>> without
>> accessing it at all, just by asking the allocator about the 
>> address.
>
> Yah, TypedAllocator can be used for exactly that. -- Andrei

Cool. Then this technique could also be used to address Timon 
Gehr's concerns about violating the type system, if necessary.


More information about the Digitalmars-d mailing list