NITCbase/nitcbase.github.io

Padding issues with struct InternalEntry on 64 bit machines

Closed this issue · 1 comments

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

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.