Spreads / Spreads.LMDB

Low-level zero-overhead and the fastest LMDB .NET wrapper with some additional native methods useful for Spreads
http://docs.dataspreads.io/spreads/libs/lmdb/api/README.html
Mozilla Public License 2.0
80 stars 9 forks source link

Alignment #17

Open buybackoff opened 5 years ago

buybackoff commented 5 years ago

Important to remember that LMDB data is practically not aligned (to 2-bytes in dupsorted from 2014 comments from googling). Issue is here to review later that now data is returned without https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.unaligned?view=netframework-4.7.2

We must use (review usage if already) Unsafe.ReadUnaligned for any pointer read to T.

For Intel x64 it's ~noop and for others it's correctness issue, so performance doesn't matter.