This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Question about empty classes


On Nov  9, 1998, Carlo Wood <carlo@runaway.xs4all.nl> wrote:

> I try hard to save memory in my designs, which is why I was
> unpleasantly surpriced to find out that egcs (1.1b) assigns
> at least 4 bytes to any empty class :/.

Actually, it assigns a 1 byte size to an empty class, but there are
alignment issues too.

Anyway, the empty base-class optimization is already implemented, and
it will be enabled together with other modifications that change the
C++ ABI.  I believe there is some compiler option to enable it; maybe
it is (implied by) -fnew-abi...

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.anu.edu.au}
Universidade Estadual de Campinas, SP, Brasil



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]