Skip to content

Commit c75a531

Browse files
committed
Minor update
1 parent 2153ee2 commit c75a531

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

roaring.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
2-
// Created by amalgamation.sh on Sun 25 Jul 2021 12:08:33 EDT
2+
// Created by amalgamation.sh on Mon 16 Aug 2021 13:20:45 EDT
33

44
/*
55
* Copyright 2016-2020 The CRoaring authors
@@ -509,7 +509,7 @@ static inline int hamming(uint64_t x) {
509509
//
510510
// On 32-bit ARM, we would have smaller registers.
511511
//
512-
// The simdjson users should still have the fallback kernel. It is
512+
// The library should still have the fallback kernel. It is
513513
// slower, but it should run everywhere.
514514

515515
//
@@ -11569,7 +11569,8 @@ container_t *get_copy_of_container(
1156911569
* is responsible for deallocation.
1157011570
*/
1157111571
container_t *container_clone(const container_t *c, uint8_t typecode) {
11572-
c = container_unwrap_shared(c, &typecode);
11572+
// We do not want to allow cloning of shared containers.
11573+
// c = container_unwrap_shared(c, &typecode);
1157311574
switch (typecode) {
1157411575
case BITSET_CONTAINER_TYPE:
1157511576
return bitset_container_clone(const_CAST_bitset(c));
@@ -11578,8 +11579,7 @@ container_t *container_clone(const container_t *c, uint8_t typecode) {
1157811579
case RUN_CONTAINER_TYPE:
1157911580
return run_container_clone(const_CAST_run(c));
1158011581
case SHARED_CONTAINER_TYPE:
11581-
printf("shared containers are not cloneable\n");
11582-
assert(false);
11582+
// Shared containers are not cloneable. Are you mixing COW and non-COW bitmaps?
1158311583
return NULL;
1158411584
default:
1158511585
assert(false);
@@ -15282,7 +15282,6 @@ void roaring_bitmap_printf_describe(const roaring_bitmap_t *r) {
1528215282
printf("%d: %s (%d)", ra->keys[i],
1528315283
get_full_container_name(ra->containers[i], ra->typecodes[i]),
1528415284
container_get_cardinality(ra->containers[i], ra->typecodes[i]));
15285-
1528615285
if (ra->typecodes[i] == SHARED_CONTAINER_TYPE) {
1528715286
printf(
1528815287
"(shared count = %" PRIu32 " )",
@@ -15384,6 +15383,7 @@ roaring_bitmap_t *roaring_bitmap_copy(const roaring_bitmap_t *r) {
1538415383

1538515384
bool roaring_bitmap_overwrite(roaring_bitmap_t *dest,
1538615385
const roaring_bitmap_t *src) {
15386+
roaring_bitmap_set_copy_on_write(dest, is_cow(src));
1538715387
return ra_overwrite(&src->high_low_container, &dest->high_low_container,
1538815388
is_cow(src));
1538915389
}
@@ -15571,7 +15571,7 @@ roaring_bitmap_t *roaring_bitmap_and(const roaring_bitmap_t *x1,
1557115571
length2 = x2->high_low_container.size;
1557215572
uint32_t neededcap = length1 > length2 ? length2 : length1;
1557315573
roaring_bitmap_t *answer = roaring_bitmap_create_with_capacity(neededcap);
15574-
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) && is_cow(x2));
15574+
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2));
1557515575

1557615576
int pos1 = 0, pos2 = 0;
1557715577

@@ -15719,7 +15719,7 @@ roaring_bitmap_t *roaring_bitmap_or(const roaring_bitmap_t *x1,
1571915719
}
1572015720
roaring_bitmap_t *answer =
1572115721
roaring_bitmap_create_with_capacity(length1 + length2);
15722-
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) && is_cow(x2));
15722+
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2));
1572315723
int pos1 = 0, pos2 = 0;
1572415724
uint8_t type1, type2;
1572515725
uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1);
@@ -15870,7 +15870,7 @@ roaring_bitmap_t *roaring_bitmap_xor(const roaring_bitmap_t *x1,
1587015870
}
1587115871
roaring_bitmap_t *answer =
1587215872
roaring_bitmap_create_with_capacity(length1 + length2);
15873-
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) && is_cow(x2));
15873+
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2));
1587415874
int pos1 = 0, pos2 = 0;
1587515875
uint8_t type1, type2;
1587615876
uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1);
@@ -16031,14 +16031,14 @@ roaring_bitmap_t *roaring_bitmap_andnot(const roaring_bitmap_t *x1,
1603116031
length2 = x2->high_low_container.size;
1603216032
if (0 == length1) {
1603316033
roaring_bitmap_t *empty_bitmap = roaring_bitmap_create();
16034-
roaring_bitmap_set_copy_on_write(empty_bitmap, is_cow(x1) && is_cow(x2));
16034+
roaring_bitmap_set_copy_on_write(empty_bitmap, is_cow(x1) || is_cow(x2));
1603516035
return empty_bitmap;
1603616036
}
1603716037
if (0 == length2) {
1603816038
return roaring_bitmap_copy(x1);
1603916039
}
1604016040
roaring_bitmap_t *answer = roaring_bitmap_create_with_capacity(length1);
16041-
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) && is_cow(x2));
16041+
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2));
1604216042

1604316043
int pos1 = 0, pos2 = 0;
1604416044
uint8_t type1, type2;
@@ -17129,7 +17129,7 @@ roaring_bitmap_t *roaring_bitmap_lazy_or(const roaring_bitmap_t *x1,
1712917129
}
1713017130
roaring_bitmap_t *answer =
1713117131
roaring_bitmap_create_with_capacity(length1 + length2);
17132-
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) && is_cow(x2));
17132+
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2));
1713317133
int pos1 = 0, pos2 = 0;
1713417134
uint8_t type1, type2;
1713517135
uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1);
@@ -17306,7 +17306,7 @@ roaring_bitmap_t *roaring_bitmap_lazy_xor(const roaring_bitmap_t *x1,
1730617306
}
1730717307
roaring_bitmap_t *answer =
1730817308
roaring_bitmap_create_with_capacity(length1 + length2);
17309-
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) && is_cow(x2));
17309+
roaring_bitmap_set_copy_on_write(answer, is_cow(x1) || is_cow(x2));
1731017310
int pos1 = 0, pos2 = 0;
1731117311
uint8_t type1, type2;
1731217312
uint16_t s1 = ra_get_key_at_index(&x1->high_low_container, pos1);

roaring.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
2-
// Created by amalgamation.sh on Sun 25 Jul 2021 12:08:33 EDT
2+
// Created by amalgamation.sh on Mon 16 Aug 2021 13:20:45 EDT
33

44
/*
55
* Copyright 2016-2020 The CRoaring authors
@@ -23,11 +23,11 @@
2323
// /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand
2424
#ifndef ROARING_INCLUDE_ROARING_VERSION
2525
#define ROARING_INCLUDE_ROARING_VERSION
26-
#define ROARING_VERSION = 0.3.3,
26+
#define ROARING_VERSION = 0.3.4,
2727
enum {
2828
ROARING_VERSION_MAJOR = 0,
2929
ROARING_VERSION_MINOR = 3,
30-
ROARING_VERSION_REVISION = 3
30+
ROARING_VERSION_REVISION = 4
3131
};
3232
#endif // ROARING_INCLUDE_ROARING_VERSION
3333
/* end file include/roaring/roaring_version.h */

0 commit comments

Comments
 (0)