Re: [sigc] sigc::trackable::~trackable() is not virtual



On Thu, 2006-10-26 at 09:41 -0400, Paul Davis wrote:
> the cost of this
> extra work (including heap allocation of an std::list) versus a
> virtual
> function call when destroying a trackable makes this concern seem
> misplaced to me. avoiding the temporary slot from doing all this stuff
> would be much more productive in terms of cycles not wasted.

(if that's correct. I have no idea. I haven't intestigated)

That's a once-per-connection cost versus an increase in size for all
objects that derive from it.

The decision was made a long time ago, not by me, and it can't be
undecided now.

> > And you might actually be better off with your virtual inheritance
> > elsewhere. Obviously it works for gtkmm, which multiply-inherits
> > sigc::trackable. Virtual inheritance is a very odd thing and doesn't
> act
> > exactly as you might expect.
> 
> no kidding. 5 days of valgrinding and gdb-ing and reading MB's of
> debugging output finally convinced me that VI was the issue. i used VI
> to avoid having to constantly specifiy which trackable of the multiple
> trackables would otherwise be present i meant, which was apparently
> what
> VI was intended for. instead, it led to gcc completely screwing up the
> class layout and consistently messing up object destruction. i've
> heard
> of at least one other story that matches this experience with VI. 

I'm not aware of any remaining gcc bugs with virtual inheritance, though
we had some a few years ago. I was suggesting that the concepts and
syntax are difficult, and you might have your virtual inheritance in the
wrong place. It's worth investigating what gtkmm does.

Bakery also does some complex virtual inheritance.
-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]