Friday, December 3, 2010

Class Size

class VAC : public virtual A {}; is 4 bytes on Solaris.

This comes from the vptr (Virtual Table Pointer) that is needed to point to the vtable (Virtual Table). The compiler needs to allocate them for virtual functions and virtual inheritance.

No comments:

Post a Comment