Robbepop / modular-bitfield

Macro to generate bitfields for structs that allow for modular use of enums.
Apache License 2.0
155 stars 40 forks source link

Question: Array of bitfields #85

Open MikeColeGuru opened 1 year ago

MikeColeGuru commented 1 year ago

I'm considering using this library ..

I'm needing to create large arrays of these.

What is the overhead as far as memory? I am storing nibble sized structs with two enums.

Robbepop commented 1 year ago

Generally the modular bitfield structs should not impose overhead besides longer compilation times due to usage of proc. macros. This library was designed to not introduce overhead anywhere. Bitfield structs are aligned to byte sized portions since underlying we are using a [u8; N] array. If you are using an array of bitfield structs you are just using an array of an array underlying.