Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-30 16:28:27


----- Original Message -----
From: "Greg Colvin" <greg_at_[hidden]>

> At 12:41 PM 04/28/2002, Beman wrote:
>
> >* LWG members are very concerned that "you don't have to pay for what
you don't use." This is particularly true of memory; increased memory
use due to multiple inheritance or to accommodate weak_ptr, for example,
is viewed as a serious problem.
>
> I don't really think that is such a big issue, unless shared objects
> are hardly shared at all

That is very commonly the case, though, c.f. containers of
shared_ptr<T>.

> , and maybe not even then.
>
> The overhead for the weak pointer need be only one word per object,
not
> per pointer, and the smart pointer itself need be only one or two
words.

Yes: when the compiler can generate small objects, you're looking at a
1.5x increase in the base memory consumption per shared object when weak
pointer support is present. Talk to Howard Hinnant about his customers'
demands and how they impacted his standard container implementations if
you don't believe this is important.

-Dave


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