Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-06-15 18:17:34


On 06/15/2005 12:47 PM, Peter Dimov wrote:
> Larry Evans wrote:

>>Maybe you could more easily find the error in the conversion of
>>sp_collector.cpp than me, if you're interested.

> I'm not sure whether we should invest any effort in porting
> sp_collector.cpp; it's not an official part of shared_ptr and
> doesn't work reliably.

Do you mean it doesn't work reliably because

   1) the test for shared_ptr existence within a gc object is
   "conservative" and could result in "false" pointers and thereby
   retain memory which should be freed

   or:

   2) the code has got a bug in it (I've no idea)

   or:

   3) the code is not thread safe (I've no idea)

   or:

   something else?

> Have you looked at reset_and_collect.cpp, which relies on
> user enumeration but is 100% portable and doesn't
   ^^^^^^^^^^^^^^^^
Do you mean each gc'ed object must have a virtual enumerate function
which enumerates the shared_ptr's contained within that object?

> need access to the shared_ptr implementation?

> http://lists.boost.org/boost-users/2005/05/11805.php

Thanks, I first looked at it today. I *may* begin trying to convert
it for use with policy_ptr, but I don't know how the reliance on a
user provided virtual enumerate function will be received; hence,
I'm sort of reluctant to convert it.

Thanks for the link and the response.

-regards,
Larry


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