On Saturday, 13 February 2016 at 01:27:49 UTC, Andrei Alexandrescu wrote:
On 02/12/2016 08:02 PM, tsbockman wrote:
What about providing a way to mark a piece of data as thread-local at
allocation time?

Yah, could be part of the metadata. Then after inspecting that bit, shared can be casted away. I consider that an optimization that doesn't add or remove generality. -- Andrei

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.

Reply via email to