boolean

Karl Heuer karl at haddock.ima.isc.com
Mon Jun 11 06:51:13 AEST 1990


In article <24.266bdce0 at spanky.mgi.com> cepek at spanky.mgi.com writes:
>OK, so to summarize the ups and downs of both ways of implementing "bool":
>           _int_8_bool_                     _bitfield_bool_
>        normal C syntax      versus     using "painful" macros
>        quicker              versus     "not too bad" time cost
>        less dense           versus     more dense (twice)

No, it's 8 times more dense (32 per word instead of 4, in the model I was
using).  And this table ignores the third option of using `int'.  My argument
is that either you have a large array of booleans so that the inconvenience of
the macros is outweighed by the space savings, or else you don't, in which
case there's also probably no advantage to using `char' rather than `int'.

Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint



More information about the Comp.lang.c mailing list