Bytemuck will just write the bytes directly, not encode it. The header is pretty small and just contains contiguous bytes so we can take this shortcut. Added an endianness check and a version check to ensure that the database isn't opened on a machine with different endianness.
Note that it might have worked before, but probably was not tested. It is possible that you could create a migrator to fix the header and the database could be openable on a machine with different endianness...
Improves performance by about 3% for insert cases, and addresses a bug where the offset of the free list may not be as expected. This bug can only occur on a re-open of the database, as it incorrectly assumed the free lists are at offset_of!(header.freelists) when writing it.
Bytemuck will just write the bytes directly, not encode it. The header is pretty small and just contains contiguous bytes so we can take this shortcut. Added an endianness check and a version check to ensure that the database isn't opened on a machine with different endianness.
Note that it might have worked before, but probably was not tested. It is possible that you could create a migrator to fix the header and the database could be openable on a machine with different endianness...
Improves performance by about 3% for insert cases, and addresses a bug where the offset of the free list may not be as expected. This bug can only occur on a re-open of the database, as it incorrectly assumed the free lists are at
offset_of!(header.freelists)
when writing it.