aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-03-05 23:05:29 +0200
committerRiccardo Spagni <ric@spagni.net>2016-03-05 23:05:29 +0200
commit80aa57a6cd4dd588259b3b403f8e073b56183954 (patch)
tree98723558e1f9935a56f54b7d12f6e7ae12b9c7bf
parentMerge pull request #693 (diff)
parentMore for df239428c0f43e2664f2be273996a734ca12c686 (diff)
downloadmonero-80aa57a6cd4dd588259b3b403f8e073b56183954.tar.xz
Merge pull request #695
f5affbe More for df239428c0f43e2664f2be273996a734ca12c686 (Howard Chu)
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 01a36a8da..08c5a8943 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -149,8 +149,14 @@ private:
int compare_uint64(const MDB_val *a, const MDB_val *b)
{
+#ifdef MISALIGNED_OK
const uint64_t va = *(const uint64_t*)a->mv_data;
const uint64_t vb = *(const uint64_t*)b->mv_data;
+#else
+ uint64_t va, vb;
+ memcpy(&va, a->mv_data, sizeof(uint64_t));
+ memcpy(&vb, b->mv_data, sizeof(uint64_t));
+#endif
if (va < vb) return -1;
else if (va == vb) return 0;
else return 1;