Howard Chu wrote: > [email protected] 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. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/
