[Box Backup-dev] COMMIT r348 - in box/chris/bb-save-state: . bin/bbackupd lib/common lib/server

Gary boxbackup-dev@fluffy.co.uk
Mon, 30 Jan 2006 17:23:09 -0800 (PST)


> Yes, the conditions you list are where the compiler can inline. But for
> a polymorphic class it is extremely rare that those can be satisfied so
> it will almost always use the vtable, thus none of the intended
> performance benefit of inline is realised.

> Now the problem the compiler faces is where to make the vtable and
> method implementations. IIRC GCC will place them in the same file as the
> first non-inline virtual method. But a problem is posed where the class
> is fully inline (as I think this one was). Now the compiler has nowhere
> to put them, so it ends up generating vtable and method code in every
> file where the class is used, relying on the linker to sort the mess
> out. This is obviously very inefficient in object size and compile time.

I see, considering the fact that it was supposed to be an utility class to start with, I should
have dropped the virtual right from the start.

Gary


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com