NITCbase / nitcbase.github.io

The entire documentation on implementing the NITCbase project.
https://nitcbase.github.io/
MIT License
10 stars 6 forks source link

Padding issues with struct InternalEntry on 64 bit machines #48

Closed SaintNerevar closed 1 year ago

SaintNerevar commented 2 years ago

InternalEntry has padding for the int32_t members on 64bit machines making its size 32 bytes instead of 24 bytes. #pragma directive must be used to force the compiler to not inject padding between members

clifordjoshy commented 1 year ago

This only becomes an issue when using memcpy from the disk representation to the memory representation. If we were to copy each field separately from the disk to the memory, then this would be a non-issue. The documentation was updated with the same. I don't think disabling packing is the ideal route to take here. Hence, closing.