Making vecdecode a header file.

This commit is contained in:
Daniel Lemire
2018-07-13 22:30:12 -04:00
parent f9534a283a
commit b4fc981447
4 changed files with 338 additions and 345 deletions
+2 -3
View File
@@ -277,7 +277,7 @@ const u32 ROOT_NODE = 1;
#define VECDECODE
#ifdef VECDECODE
#include "vecdecode.c"
#include "vecdecode.h"
#endif
// just transform the bitmask to a big list of 32-bit integers for now
// that's all; the type of character the offset points to will
@@ -287,8 +287,7 @@ never_inline bool flatten_indexes(size_t len, ParsedJson & pj) {
u32 * base_ptr = pj.structural_indexes;
base_ptr[DUMMY_NODE] = base_ptr[ROOT_NODE] = 0; // really shouldn't matter
#ifdef VECDECODE
u32 number = bitmap_decode_avx2(pj.structurals, len, base_ptr + NUM_RESERVED_NODES) + NUM_RESERVED_NODES;
u32 number = bitmap_decode_avx2(pj.structurals, len, base_ptr + NUM_RESERVED_NODES) + NUM_RESERVED_NODES;
pj.n_structural_indexes = number;
base_ptr[pj.n_structural_indexes] = 0; // make it safe to dereference one beyond this array
return true;