RC buffer

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 2 06:00:01 PDT 2016


On 11/2/16 7:42 AM, anonymous wrote:
> BTW about this PR: why RCString an not more generally RCArray ?

RCArray comes on top of RCBuffer. That way we isolate the matter of 
reference counting the buffer itself from the matter of managing the 
objects stored in the buffer. It's a simple matter of modularity. 
(Matters of alignment make this a bit more involved than it might seem, 
but nothing crazy.)

What is important (and probably unprecedented) about this PR is that 
it's the first reference counted artifact that works with qualifiers 
without resorting to undefined casts. That's the Big Thing about it. It 
harkens back to Dicebot idea to stash the reference counter in the 
allocator.


Andrei



More information about the Digitalmars-d mailing list