Howard Chu wrote:
bach@bullno1.com wrote:
I have read a few threads on lmdb alignment but I am still not clear on what kind of padding should be done.
Use case: I want to store aligned SIMD vectors in the value and operate on them directly with SIMD instructions without copying.
As I understand it, lmdb guarantees 2-byte alignment. However, it can also move nodes around for tree rebalancing or page reclaiming. Thus, merely aligning the key and value might not be enough.
LMDB's own headers are aligned to 16 byte boundaries. If your keys+values are also aligned to 16 byte boundaries then nodes shuffling around will have no effect on their alignment.