[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Alternatives to reference counting
- From: TNHarris <telliamed@...>
- Date: Thu, 28 May 2009 20:08:23 -0400
On Wed, 27 May 2009 08:47:38 +0200
steve donovan <firstname.lastname@example.org> wrote:
> Have a look at:
> RAII (so beloved of C++) is a very useful pattern
Thank you. I must have overlooked that since I wasn't intending to add
syntax. This should help with the linkset, since only a deranged script
would dare copy an active iterator to a global variable.
For the event data, I found that it's a reference-counted pointer
already, so I can just increment that, and it doesn't matter how long it
takes the data to be collected.
Out of curiosity, what are the pros and cons of the __copy metamethod?
The last discussion of this I found ended without a clear answer. A
difficulty I forsee is that you'd also need copy-on-write, else you'll
waste a lot of time copying values when a reference would suffice.