Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-09-21 08:53:55


On 09/21/07 06:26, Larry Evans wrote:
> On 09/21/07 04:14, Achilleas Margaritis wrote:
[snip]
> The collector offers the possibility of customizing the scanning
>> procedure (the procedure which scans a block for pointers) through the
>> class gc_traits<T>. So if there is a data structure where gc_ptr<T> can
>> not be used, a custom scan routine especially coded for the data
>> structure in question can solve the problem.
>
> Given the following:
>
> std::list<gc_ptr<Node> > node_list;
>
> where Node is defined in cppgc/src/main.cpp,
> then no gc_ptr's within node_list would be
> registered as root pointers; so, wouldn't
> any Nodes of the gc_ptr's pushed into node_list be
> collected? I guess I don't understand how a customized
> scanner would help. Sure, once it's known that
[snip]
boost-vault/memory/main_stl.zip contains a main program
showing a segfault. The only diff with cppgc/src/main.cpp
is that GCBench is templated so that the Node's
contained gc_ptr<Node>'s are either stored in std::pair
or in std::list, depending on newly added template
param to GCBench.

The zip also contains a gdb session showing the segfault
when using std::pair.


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