Date: 2001-05-05 22:22:20
--- In boost_at_y..., John Max Skaller <skaller_at_o...> wrote:
> scleary_at_j... wrote:
> > there is one possibility, though:
> > I'm assuming that you have a special pointer type (or
> > pointer type)
> No. The collector works with ordinary pointers.
> > I don't know what exactly you're trying to do with your library,
so I can't
> > say if this change is feasable or not; it's just a thought...
> The purpose of the library, in the first instance, is to
> allow collection of C++ objects (with finalisation).
> gc1 doesn't support reference counting.
> The client calls 'collect', and garbage is collected in random
> order, finalisers are executed.
> This is quite sufficient for many data structures.
> However, if one is using constructors/destructors for resource
> acquisition/release, and there are dependencies amoung the
> resources, it isn't enough. Also, it can be very expensive to
> call the collector to release scarce resources in a timely
> manner. Hence, I see a need to add reference counting.
> This would allow release and finalisation of objects
> _immediately_ the object becomes unreachable, provided the object
> isn't part of a cycle.
If you changed the collector to use smart pointers, then you
could use the method in
for collecting cycles. What are the reasons for not using smart
> Immediate release also helps minimise the work of the collector.
> In fact, the collector could be eliminated entirely in some cases.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk