How does this library handle bool type variables? #24
-
I wonder how this library handles bool type variables. Will each single boolean occupie one byte, or is there some optimization in place to use only one bit per boolean? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The library doesn't do any particular optimization on a per data-type basis, in other words the occupied memory is If you have the need for bit manipulation you need a specialized implementation which, if done properly, is going to be a welcome addition 😉 |
Beta Was this translation helpful? Give feedback.
The library doesn't do any particular optimization on a per data-type basis, in other words the occupied memory is
n * sizeOf(dataType)
wheren
is the circular buffer size andsizeOf(dataType)
is the memory occupation for a particular data type. On certain architectures, abyte
actually occupies 4 bytes and in practically any architecture I know abool
takes an entire byte.If you have the need for bit manipulation you need a specialized implementation which, if done properly, is going to be a welcome addition 😉