Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-09-03 09:27:01


Larry Evans wrote:

[...]

> (i.e. ~T() ) are run when get_count() == 0. OOPS. Except when there are
> cycles in the pointer graph :(. The only way around this is possibly to
> diagnose
> this problem during the conservative garbage collection and issue a
> warning. This wouldn't cause any bugs, it would just waste space, and the

...space & time...

> programmer could eventually track down the cycle and correct it by making
> the closing of the cycle a weak pointer (like Greg/Beman/Peter's
> weak_ptr). Also, if the programmer were really paranoid about cycles, he
> could cause any pointer
> assignment to check whether the assignment produced a cycle. Also, the
> collection could be made precise instead of conservative by using some
> variation Greg's cyclic_ptr algorithm.

This could be an option defined by a global variable or flag, because I
guess the cyclic_ptr algorithm will have to be called for each pointer
construction (or destruction) on the heap (too bad there is no portable way
to detect the memory segment on which construction is made).

-- 
Philippe A. Bouchard

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk