An important pull request: accessing shared affix for immutable data
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Fri Feb 12 16:30:58 PST 2016
On 02/12/2016 06:52 PM, deadalnix wrote:
> Providing some metadata in the allocate is in itself a good idea.
> Locating these data with the object is usually not :
> - Mutating the metadata will create sharing overhead on the whole
> cache line. Sharing of immutable would become inefficient.
> - It tends to create allocation size that aren't friendly to
> underlying allocators. For instance, an alocation of size 2^n + 8 bumps
> you to the next size class, often 2^(n+1) or alike. This creates a lot
> of internal fragmentation.
> - Buffer overflow/underflow WILL spill in the alocator metadata. You
> don't want that. This pretty much guaranteed that the worse thing that
> can happen will happen: corrupting the alocator.
>
> jemalloc moved away from using them for small runs for these reasons.
I think we're good there. -- Andrei
More information about the Digitalmars-d
mailing list