Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2003-10-07 09:07:35


cppljevans_at_[hidden] wrote:

[...]

>> This is called a group "merge"; * a.m_ind will get destructed and
>> will point to * b.m_ind.
> Sorry to keep pestering, but I'm still unsure...
> Wouldn't other member's of a's original group then be pointing to a
> destructed *m_ind. Maybe you mean "if *m_ind==0"?

Sorry! I need vacations... ;)

m_ind is a pointer of pointer:
long ** m_ind;

- a->m_ind will point to the "indicator"
- one of {* a->m_ind, * b->m_ind} will get destructed when two groups are
merged

I am glad you figured this one out.

> But if a joins
> b's group, this means a and b are in a cycle? Or maybe you meant
> something beside "are in a cycle" in your definition of
> a group in the 10/06/2003 03:32 PM,CST post:
>> Group: group of pointees on the heap refering to themselves.

It is imprecise:

Group: group of pointees refering to themselves on the heap having a number
of roots on the stack. It does not necessarily form a cyclic whole.

> Jone & Lin's _Garbage Collection_, p.71 at:
>
> http://www.cs.kent.ac.uk/people/staff/rej/gcbook/gcbook.html
>
> describes something that, at least on the surface, sounds
> somewhat similar:
>
> If cycles can only be created in predicatable
> circumstances, or restrictions are placed on
> programming style, it may be possible to treat
> cycles as a whole, i.e. with a single reference
> count, and delete it automically with the count
> drops to zero.

Exactly, this is the idea but it wouldn't fit anymore if
sizeof(shared_ptr<>) is going to be sizeof(void *) * 3. Only the actual
shifted_ptr design could handle it for now until it is passed on to
shared_ptr.

Philippe


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