Date: 2003-10-10 20:03:53
On 10/10/2003 07:42 PM, Philippe A. Bouchard wrote:
> cppljevans_at_[hidden] wrote:
>>This call is made each time the reference count is decremented
>>or incremented for a polymorphic instance, AFAICT.
> Exactly, I was currently implementing the "real-time" collector (destructs
> objects instantaneously upon cyclic references) before redocumenting it. I
> am glad you point those out.
> I wouldn't call those "con"s because as for the first issue, similar
> problems will occur if you cast a shared_ptr<C> -> shared_ptr<B> & C * -> B
> *: there is no way to destruct the objects correctly after the hidden
> address shift. The second one truly calls a virtual function but it is
shared_ptr does it by having 2 pointers to the object. The first is
stored in shared_ptr::pn. It points to the start of the object. The
second, which may point to inside of the object after conversion from
the most derived class, is shared_ptr::px.
> really negligeable, believe me.
Well, the only reason I mention it is because some "authorities"
have mentioned it. For example, in Jones&Lin's _Garbage Collection_, p.24:
The most serious disadvantage is the high processing cost...paid to
update counters to maintain the reference count invariant.
> I would vote to implement garbage collection for its true purpose: immediate
> speed. You will find a good document about it here:
Thanks, I'll take a look.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk