This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about empty classes
- To: carlo at runaway dot xs4all dot nl, egcs at cygnus dot com
- Subject: Re: Question about empty classes
- From: mrs at wrs dot com (Mike Stump)
- Date: Tue, 10 Nov 1998 15:43:15 -0800
> From: Carlo Wood <carlo@runaway.xs4all.nl>
> To: egcs@cygnus.com
> Date: Mon, 9 Nov 1998 14:10:23 +0100 (CET)
> 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 :/.
* An _experimental_ new ABI for g++ can be turned on with -fnew-abi. The
current features of this are more efficient allocation of base classes
(including the empty base optimization)
If you don't care about abi, you can switch the default to on, and
recompile the compiler, and your app. I don't recommend just using
the switch (because of libstdc++).