From 1e65d28e5b16c2621587e4ce3ebb48bb881b019a Mon Sep 17 00:00:00 2001 From: jsteemann Date: Thu, 15 Dec 2016 16:26:27 +0100 Subject: [PATCH] align memory for ARM --- arangod/FulltextIndex/fulltext-index.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arangod/FulltextIndex/fulltext-index.cpp b/arangod/FulltextIndex/fulltext-index.cpp index b25f13d0f7..59dcd9192a 100644 --- a/arangod/FulltextIndex/fulltext-index.cpp +++ b/arangod/FulltextIndex/fulltext-index.cpp @@ -36,7 +36,13 @@ /// @brief use padding for pointers in binary data //////////////////////////////////////////////////////////////////////////////// +#ifdef __arm__ +// must properly align memory on ARM architecture to prevent +// unaligned memory accesses +#define FULLTEXT_PADDING 1 +#else #undef FULLTEXT_PADDING +#endif //////////////////////////////////////////////////////////////////////////////// /// @brief maximum length of an indexed word in bytes @@ -210,6 +216,7 @@ void DumpNode(const node_t* const node, uint32_t level) { static inline size_t Padding(uint32_t numEntries) { #ifdef FULLTEXT_PADDING + size_t const PAD = 8; size_t offset = sizeof(uint8_t) + // numAllocated sizeof(uint8_t) + // numUsed (sizeof(node_char_t) * numEntries); // followerKeys