Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-05-25 15:47:54

Larry just did me the favor of putting updated copies of my simple
cyclic_ptr at:

Like Felix it combines reference counting with garbage collection.
It requires no special operator new and can collect arbitrary data
types. It requires that collectable objects be referenced by a
cyclic_ptr<> smart pointer, and imposes some restrictions on the
user-supplied operator= for types with cyclic_ptr<> members (the
default generated operator= is fine as is).

The implementation is a simple-minded stop-the-world-mark-sweep that
makes no attempts at thread safety or maximum performance, but that
has the advantage for now of brevity, and perhaps clarity.

The interface is a subset of shared_ptr. It should be all of
shared_ptr, but I haven't taken time to add std::swap and std::less.
In addition, a simple weak_ptr is provided whose get() member returns
null if the shared object has been collected.

----- Original Message -----
From: Larry Evans <jcampbell3_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, May 23, 2001 6:31 PM
Subject: Re: [boost] Smart pointer status, directions, thoughts

> John Max Skaller wrote:
> > Beman Dawes wrote:
> >
> > > Greg Colvin, Kevlin Henney, and I discussed smart pointer "big-picture"
> > > issues at the recent C++ committee meeting.
> >
> > []
> >
> > You might also look at the experimental Felix GC system
> > available on boost. This combines reference counting
> > with garbage collection to solve some of the problems
> > ref counting has with circular data structures.
> >
> > The basic idea is to collect garbage, but to solve
> > some of the performance and order and time
> > of finalisation problems by also supporting
> > reference counting and explicit destruction.
> >
> > Although usage is not transparent, arbitrary
> > data types can be collected (the technique
> > is non-invasive). Of some 'Standards conformance'
> > interest is that finalisers need not call destructors.
> The gc_sel_ssp.doc file which I've just uploaded has a comparison
> of some existing boost gc methods. The cyclic_ptr method
> is also non-invasive and does not suffer from the
> "dynamic proxy container problem" which I believe the Felix method
> does suffer from, as I suggested in another recent boost post. I
> also think cyclic_ptr may be fastest doing the collection, but this is offset
> some by the more frequent need to update refcounts. However,
> the comparisons still need some work. The cyclic_ptr analysis is
> the most advanced. Of course I would also appreciate any corrections
> of the analysis done so far.
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
> Your use of Yahoo! Groups is subject to

Boost list run by bdawes at, gregod at, cpdaniel at, john at