Hi,

looking into gcc source code, I noticed that in some structure definition
'bool' was used and in other ones bitfields were used. In some other cases
there is also a mix of the two ! (for exemple in 'dwarf2out.c' - struct
dw_fde_struct). Finaly, some even defined a BOOL_BITFIELD which looks like a
bool but is an unsigned int !

In most common cases I think that bool or bitfield have the same
functionality.


Bitfields take less memory than bool but I think that bool are faster *in
theory* (i.e. no masking needed but may also use more cache memory and
result in slower code...)


Is there a prefered version ?
Do you think that looking deeper into would be interesting and would impove
gcc ?
Is there an *easy* way to compare memory consuption and execution time to
figure out which version should be prefered ?


Christophe Jaillet



Reply via email to