Boost logo

Boost :

From: Greg Colvin (Gregory.Colvin_at_[hidden])
Date: 2002-08-29 17:13:54

At 03:58 PM 8/29/2002, Larry Evans wrote:
>Philippe A. Bouchard wrote:
>>Greg Colvin wrote:
>>>Which is what makes it possible to retrieve the counter, given
>>>a pointer into the object, or vice versa. Or at least to do it
>>>quickly. OK. But then I still say that ptr<T> can just hold an
>>>actual T*, and the rest of Phillippe's machinery should be
>>1) Click on the following:
>>2) It's not [...] as before [...] was sim-pli-fied.
>The recent changes to ptr.hpp removed the static vector of
>offsets from the start of the object. These were simply replaced
>with calls to dynamic_cast<void*>(T*) and then a pointer
>adjustment to get to the reference count. So the latest changes,
>as far as I can see, do just about what Greg suggests.

Thanks. I've barely time to follow this discussion, and even
less for reading and re-reading a rapidly changing code base.

> Since each
>reference count adjustment is now slowed down by a call to
>dynamic cast, new benchmarks results would be useful.

This sounds like a potential performance killer.

>it would be useful to compare the space usage in terms of
>vertices, V, and arcs, A, in the pointer graph. For ptr, I think it's
> V*sizeof(refcount) + A*0
>The A*0 is because the sizeof (T*) is not counted since it's the same
>size used by a raw pointer. The above figure is for just the additional
>space. The virtual function table(allowing use of dynamic cast) is not
>included in the V factor because the assumption is that all objects
>pointed to already have virtual functions.
>Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at