Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-05-20 12:15:53


On 05/20/2006 07:28 AM, Achilleas Margaritis wrote:
> Dear boost developers,
>
> Is there any interest for a small portable garbage collection library?

Yes.

[snip]
> Features:
>
> -small (under 2000 LOC)
> -portable (no lowlevel OS/CPU/compiler-specific features)
> -precise mark & sweep collection

How is the precision achieved without compiler support?

> -no dependencies; headers only
> -weak pointers
> -garbage-collected arrays

Why are array specifically mentioned? Does this mean they have
to be declared as garbage collected?

[snip]
> I have posted an article on www.codeproject.com about it along with the
> source code, code documentation and unit tests. It can be found here:
>
> http://www.codeproject.com/useritems/libgc.asp
[snip]
> Even if boost devs find no value in it, I would appreciate any feedback.

I'll probably have some as soon as I can read and understand the above
link. Meanwhile, you might want to compare it with the precise
collector in the policy_ptr library in boost sandbox. The test for
a precise collector (as well as conservative and flawed [w.r.t. stl
container or most any container with dynamic allocatio]) is here:

   http://tinyurl.com/njce2

the precise collector is the one tested with the:

   test_adder.add_spid<std_shared_graph_accepting>();

statements. I know it's hard to decipher the code, but I haven't
got around to documenting it yet. Besides, I'm in the midst of
rewriting the whole "backbone" of the precise collector. This
backbone simply allows enumeration of selected "fields" of
any class. The selected fields, in the case of the precise
collector, are those smart_ptr's that are:

   std_ptr<T>::shared_accepting;

which is defined here:

   http://tinyurl.com/fyzoc

the "backbone" was in the boost sandbox under fields_visitor; however,
as mentioned, I'm refactoring it in response to feedback from
David Abrahams in the post:

   http://archives.free.net.ph/message/20060125.200646.b14e2a82.en.html

Anyway, I'll get back to you with more feedback.

Thanks for the another alternative gc look look at and
learn from.

-regards,
Larry


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