I am in a memory constrained x64 system and I need to hold a lot of data in memory. What are the disadvantages of using this kind of data structure.
struct entity
{
unsigned int hash : 26;
unsigned int timestamp : 14;
} __attribute__ ((__packed__));
I know that using bit fields is discouraged, but what are the worst drawbacks in using this non aligned data structure.
The structure will be used in memory storage and some performance degradation is expected.
Disadvantages (non-exhaustive list):
sizeof
to individual membersIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With