-
-
Save andreas/e7ad3a03eeaa1a30e270785699dd7588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/include/roaring/containers/array.h b/include/roaring/containers/array.h | |
index 3a3fe82..071b0b2 100644 | |
--- a/include/roaring/containers/array.h | |
+++ b/include/roaring/containers/array.h | |
@@ -68,6 +68,7 @@ void array_container_free(array_container_t *array); | |
array_container_t *array_container_clone(const array_container_t *src); | |
/* Get the cardinality of `array'. */ | |
+ALLOW_UNALIGNED | |
static inline int array_container_cardinality(const array_container_t *array) { | |
return array->cardinality; | |
} | |
@@ -214,6 +215,7 @@ static inline int32_t array_container_size_in_bytes( | |
/** | |
* Return true if the two arrays have the same content. | |
*/ | |
+ALLOW_UNALIGNED | |
static inline bool array_container_equals( | |
const array_container_t *container1, | |
const array_container_t *container2) { | |
diff --git a/include/roaring/containers/bitset.h b/include/roaring/containers/bitset.h | |
index b8c1364..15767a2 100644 | |
--- a/include/roaring/containers/bitset.h | |
+++ b/include/roaring/containers/bitset.h | |
@@ -232,6 +232,7 @@ static inline bool bitset_container_contains_range(const bitset_container_t *bit | |
} | |
/* Get the number of bits set */ | |
+ALLOW_UNALIGNED | |
static inline int bitset_container_cardinality( | |
const bitset_container_t *bitset) { | |
return bitset->cardinality; | |
diff --git a/include/roaring/containers/run.h b/include/roaring/containers/run.h | |
index 4b01d59..673fde8 100644 | |
--- a/include/roaring/containers/run.h | |
+++ b/include/roaring/containers/run.h | |
@@ -481,6 +481,7 @@ static inline int32_t run_container_size_in_bytes( | |
/** | |
* Return true if the two containers have the same content. | |
*/ | |
+ALLOW_UNALIGNED | |
static inline bool run_container_equals(const run_container_t *container1, | |
const run_container_t *container2) { | |
if (container1->n_runs != container2->n_runs) { | |
diff --git a/src/containers/array.c b/src/containers/array.c | |
index b4adc2d..312f7c6 100644 | |
--- a/src/containers/array.c | |
+++ b/src/containers/array.c | |
@@ -376,6 +376,7 @@ void array_container_intersection_inplace(array_container_t *src_1, | |
} | |
} | |
+ALLOW_UNALIGNED | |
int array_container_to_uint32_array(void *vout, const array_container_t *cont, | |
uint32_t base) { | |
int outpos = 0; | |
diff --git a/src/containers/bitset.c b/src/containers/bitset.c | |
index 3142184..25248e0 100644 | |
--- a/src/containers/bitset.c | |
+++ b/src/containers/bitset.c | |
@@ -686,6 +686,7 @@ BITSET_CONTAINER_FN(andnot, &~, _mm256_andnot_si256, vbicq_u64) | |
// clang-format On | |
+ALLOW_UNALIGNED | |
int bitset_container_to_uint32_array( | |
uint32_t *out, | |
const bitset_container_t *bc, | |
@@ -816,6 +817,7 @@ bool bitset_container_iterate64(const bitset_container_t *cont, uint32_t base, r | |
#ifdef CROARING_IS_X64 | |
CROARING_TARGET_AVX2 | |
+ALLOW_UNALIGNED | |
static inline bool _avx2_bitset_container_equals(const bitset_container_t *container1, const bitset_container_t *container2) { | |
const __m256i *ptr1 = (const __m256i*)container1->words; | |
const __m256i *ptr2 = (const __m256i*)container2->words; | |
@@ -832,6 +834,7 @@ static inline bool _avx2_bitset_container_equals(const bitset_container_t *conta | |
CROARING_UNTARGET_REGION | |
#endif // CROARING_IS_X64 | |
+ALLOW_UNALIGNED | |
bool bitset_container_equals(const bitset_container_t *container1, const bitset_container_t *container2) { | |
if((container1->cardinality != BITSET_UNKNOWN_CARDINALITY) && (container2->cardinality != BITSET_UNKNOWN_CARDINALITY)) { | |
if(container1->cardinality != container2->cardinality) { | |
diff --git a/src/containers/run.c b/src/containers/run.c | |
index ee8a4bc..bde8a53 100644 | |
--- a/src/containers/run.c | |
+++ b/src/containers/run.c | |
@@ -625,6 +625,7 @@ void run_container_andnot(const run_container_t *src_1, | |
} | |
} | |
+ALLOW_UNALIGNED | |
int run_container_to_uint32_array(void *vout, const run_container_t *cont, | |
uint32_t base) { | |
int outpos = 0; | |
@@ -830,6 +831,7 @@ int run_container_rank(const run_container_t *container, uint16_t x) { | |
#ifdef CROARING_IS_X64 | |
CROARING_TARGET_AVX2 | |
+ALLOW_UNALIGNED | |
/* Get the cardinality of `run'. Requires an actual computation. */ | |
static inline int _avx2_run_container_cardinality(const run_container_t *run) { | |
const int32_t n_runs = run->n_runs; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment