1
0
Fork 0

align memory for ARM

This commit is contained in:
jsteemann 2016-12-15 16:26:27 +01:00
parent 3939d5e2d8
commit 1e65d28e5b
1 changed files with 7 additions and 0 deletions

View File

@ -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