[LAD] Integer performance

Will Godfrey willgodfrey at musically.me.uk
Sun May 3 20:02:55 UTC 2015


On Sat, 2 May 2015 20:53:15 +0000
Fons Adriaensen <fons at linuxaudio.org> wrote:

> On Sat, May 02, 2015 at 08:57:25PM +0100, Will Godfrey wrote:
> 
> > > What masking?
> > 
> > Presumably bits have to be masked when being set or read to provide the boolean
> > action. I wouldn't expect true single bit direct storage to be available.
> 
> No, the compiler will use one of the available int sizes (again
> depending on CPU) and just test for zero/not-zero. It will not
> try to use each bit separately. 
> 
> For arrays of bool, GCC uses a char for each bool.

Ouch! that could get expensive - although I doubt it will ever be an issue for
me. Certainly worth remembering though.

-- 
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


More information about the Linux-audio-dev mailing list