Making RCSlice and DIP74 work with const and immutable

via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 2 01:26:51 PST 2015


On Sunday, 1 March 2015 at 20:39:54 UTC, Michel Fortin wrote:
> There's a problem with reference counting immutable objects: 
> they are implicitly shared. Any metadata attached to them thus 
> needs to be shared. Accessing the metadata through a global 
> shared hash table isn't going to be that much of a performance 
> hit compared to whatever mechanism is used to synchronize 
> access to that data.

But there is no difference between having metadata as part of the 
object and using a hash table as long as the mutable and 
immutable data sits on separate cache lines. (The object address 
is basically a hash key, and memory is a big table).


More information about the Digitalmars-d mailing list