Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 1998-12-07 09:50:44

Greg Colvin (gcolvin_at_[hidden]) wrote:

>Recall (as you may already) that both versions store the count on
>the heap:
> "direct":
> object <- shared_ptr -> count
> "indirect":
> shared_ptr -> count -> object
>You understand this stuff better than I do, but I don't really see how
>the "indirect" version suffers compared to the "direct", though it might
>depend a lot on the memory manager. Perhaps some decent memory managers
>would be a good addition to Boost.

In programs where the object being referred is used much more often than
the count (that seems like the likliest scenario), the indirect version
would often force the an additional cache line to be replaced just to get
the actual pointer to the object.

David Abrahams * Mark of the Unicorn, Inc. * abrahams_at_[hidden]

Free Web-based e-mail groups --

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