Boost logo

Boost :

From: Dave Abrahams (dave_at_[hidden])
Date: 2003-02-06 15:28:12


On Thursday, February 06, 2003 3:13 PM [GMT+1=CET],
David B. Held <dheld_at_[hidden]> wrote:

> "David B. Held" <dheld_at_[hidden]> wrote in message
> news:b1m57m$702$1_at_main.gmane.org...
> > > > [...]
> > > > I mean, the optimally_inherit eliminates the empty bases, and
> > > > yet there is size bloat. So VC++ makes the class bigger for
> > > > some other reason than that it has empty bases. I will try to
> > > > write some tests to see why that is, or at least how.
> > >
> > > I repeat, I bet it's MI-related.
> >
> > The proof of the pudding is in the eating.
>
> I got a chance to taste the pudding, the the results are inconclusive.
> The cause of the size bloat was that I had changed ref_counted to
> inherit from noncopyable. Seems like an innocent enough change.
> Seems that for the single-inheritance case, we should see some
> EBO action, right? Well, we do, unless ref_counted is a base in
> an MI hierarchy. Why its place in an hierarchy should change its
> size is a mystery to me,

What do you mean that its *place* in the hierarchy affects the size? If it's
in the hierarchy, it's a base.

> but taking out noncopyable restores that
> magical size. Now, I would appreciate it if people with Intel, CW,
> and some other compilers would try out the code in the sandbox
> and see if the first test passes (turn on --log-level=all, and pipe the
> output to your favorite paginator).

BTW, these are not the kind of tests I was thinking of. I was more
interested in simple tests with SI and MI using dummy classes with zero or
more data members and trivial/non-trivial ctors/dtors.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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