aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2025-06-03 07:29:44 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2025-06-03 07:42:50 +0300
commit2a2038ed88c9329ca3b60284e9fa32f7d6b56482 (patch)
tree883ef22e73b6f71b28e3af9d237a4c4762454a59
parent6b98a46abdd2f0b446fcc0efeeea8671021cf756 (diff)
downloadydb-2a2038ed88c9329ca3b60284e9fa32f7d6b56482.tar.gz
Update contrib/libs/croaring to 4.3.2
commit_hash:44e7ead74b54c7109589eaa9eab7b4ca9caaf521
-rw-r--r--contrib/libs/croaring/.yandex_meta/override.nix4
-rw-r--r--contrib/libs/croaring/include/roaring/roaring.h30
-rw-r--r--contrib/libs/croaring/include/roaring/roaring64.h10
-rw-r--r--contrib/libs/croaring/src/art/art.c24
-rw-r--r--contrib/libs/croaring/src/roaring64.c8
-rw-r--r--contrib/libs/croaring/ya.make4
6 files changed, 52 insertions, 28 deletions
diff --git a/contrib/libs/croaring/.yandex_meta/override.nix b/contrib/libs/croaring/.yandex_meta/override.nix
index 2c7a84ab8f6..368c897d276 100644
--- a/contrib/libs/croaring/.yandex_meta/override.nix
+++ b/contrib/libs/croaring/.yandex_meta/override.nix
@@ -1,12 +1,12 @@
pkgs: attrs: with pkgs; with attrs; rec {
pname = "croaring";
- version = "4.3.1";
+ version = "4.3.2";
src = fetchFromGitHub {
owner = "RoaringBitmap";
repo = "CRoaring";
rev = "v${version}";
- hash = "sha256-c4o8AMCtDGLChXxJKJyxkWhuYu7axqLb2ce8IOGk920=";
+ hash = "sha256-IAQ6w3J/EbkPBGF5AH7jG7JqdCnrRY55+7df33Sbe78=";
};
patches = [];
diff --git a/contrib/libs/croaring/include/roaring/roaring.h b/contrib/libs/croaring/include/roaring/roaring.h
index 430abfe182f..a45b1dab76f 100644
--- a/contrib/libs/croaring/include/roaring/roaring.h
+++ b/contrib/libs/croaring/include/roaring/roaring.h
@@ -63,12 +63,14 @@ inline void roaring_bitmap_init_cleared(roaring_bitmap_t *r) {
/**
* Add all the values between min (included) and max (excluded) that are at a
* distance k*step from min.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_from_range(uint64_t min, uint64_t max,
uint32_t step);
/**
* Creates a new bitmap from a pointer of uint32_t integers
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_of_ptr(size_t n_args, const uint32_t *vals);
@@ -92,6 +94,11 @@ inline void roaring_bitmap_set_copy_on_write(roaring_bitmap_t *r, bool cow) {
}
}
+/**
+ * Return a copy of the bitmap with all values shifted by offset.
+ * The returned pointer may be NULL in case of errors. The caller is responsible
+ * for freeing the return bitmap.
+ */
roaring_bitmap_t *roaring_bitmap_add_offset(const roaring_bitmap_t *bm,
int64_t offset);
/**
@@ -150,6 +157,7 @@ CROARING_DEPRECATED roaring_bitmap_t *roaring_bitmap_of(size_t n, ...);
/**
* Copies a bitmap (this does memory allocation).
* The caller is responsible for memory management.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_copy(const roaring_bitmap_t *r);
@@ -181,6 +189,7 @@ void roaring_bitmap_printf(const roaring_bitmap_t *r);
* bitmaps, two-by-two, it is best to start with the smallest bitmap.
* You may also rely on roaring_bitmap_and_inplace to avoid creating
* many temporary bitmaps.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_and(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
@@ -243,6 +252,7 @@ void roaring_bitmap_and_inplace(roaring_bitmap_t *r1,
/**
* Computes the union between two bitmaps and returns new bitmap. The caller is
* responsible for memory management.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_or(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
@@ -258,6 +268,7 @@ void roaring_bitmap_or_inplace(roaring_bitmap_t *r1,
* Compute the union of 'number' bitmaps.
* Caller is responsible for freeing the result.
* See also `roaring_bitmap_or_many_heap()`
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_or_many(size_t number,
const roaring_bitmap_t **rs);
@@ -273,6 +284,7 @@ roaring_bitmap_t *roaring_bitmap_or_many_heap(uint32_t number,
/**
* Computes the symmetric difference (xor) between two bitmaps
* and returns new bitmap. The caller is responsible for memory management.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_xor(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
@@ -286,6 +298,7 @@ void roaring_bitmap_xor_inplace(roaring_bitmap_t *r1,
/**
* Compute the xor of 'number' bitmaps.
* Caller is responsible for freeing the result.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_xor_many(size_t number,
const roaring_bitmap_t **rs);
@@ -293,6 +306,7 @@ roaring_bitmap_t *roaring_bitmap_xor_many(size_t number,
/**
* Computes the difference (andnot) between two bitmaps and returns new bitmap.
* Caller is responsible for freeing the result.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_andnot(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
@@ -586,6 +600,8 @@ size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf);
* This function is endian-sensitive. If you have a big-endian system (e.g., a
* mainframe IBM s390x), the data format is going to be big-endian and not
* compatible with little-endian systems.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf);
@@ -602,6 +618,8 @@ roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf);
* The difference with `roaring_bitmap_deserialize()` is that this function
* checks that the input buffer is a valid bitmap. If the buffer is too small,
* NULL is returned.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_deserialize_safe(const void *buf,
size_t maxbytes);
@@ -626,6 +644,8 @@ size_t roaring_bitmap_size_in_bytes(const roaring_bitmap_t *r);
* This function is endian-sensitive. If you have a big-endian system (e.g., a
* mainframe IBM s390x), the data format is going to be big-endian and not
* compatible with little-endian systems.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
@@ -661,6 +681,8 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
* This function is endian-sensitive. If you have a big-endian system (e.g., a
* mainframe IBM s390x), the data format is going to be big-endian and not
* compatible with little-endian systems.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_portable_deserialize_safe(const char *buf,
size_t maxbytes);
@@ -684,6 +706,8 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize_safe(const char *buf,
* This function is endian-sensitive. If you have a big-endian system (e.g., a
* mainframe IBM s390x), the data format is going to be big-endian and not
* compatible with little-endian systems.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_portable_deserialize_frozen(const char *buf);
@@ -833,6 +857,8 @@ bool roaring_bitmap_is_strict_subset(const roaring_bitmap_t *r1,
*
* `bitsetconversion` is a flag which determines whether container-container
* operations force a bitset conversion.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_lazy_or(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2,
@@ -868,6 +894,8 @@ void roaring_bitmap_repair_after_lazy(roaring_bitmap_t *r1);
*
* It is safe to repeatedly call `roaring_bitmap_lazy_xor_inplace()` on
* the result.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_lazy_xor(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
@@ -884,6 +912,7 @@ void roaring_bitmap_lazy_xor_inplace(roaring_bitmap_t *r1,
* Compute the negation of the bitmap in the interval [range_start, range_end).
* The number of negated values is range_end - range_start.
* Areas outside the range are passed through unchanged.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_flip(const roaring_bitmap_t *r1,
uint64_t range_start, uint64_t range_end);
@@ -892,6 +921,7 @@ roaring_bitmap_t *roaring_bitmap_flip(const roaring_bitmap_t *r1,
* Compute the negation of the bitmap in the interval [range_start, range_end].
* The number of negated values is range_end - range_start + 1.
* Areas outside the range are passed through unchanged.
+ * The returned pointer may be NULL in case of errors.
*/
roaring_bitmap_t *roaring_bitmap_flip_closed(const roaring_bitmap_t *x1,
uint32_t range_start,
diff --git a/contrib/libs/croaring/include/roaring/roaring64.h b/contrib/libs/croaring/include/roaring/roaring64.h
index e185b48aaea..d5c73c61504 100644
--- a/contrib/libs/croaring/include/roaring/roaring64.h
+++ b/contrib/libs/croaring/include/roaring/roaring64.h
@@ -39,12 +39,14 @@ typedef struct roaring64_bulk_context_s {
/**
* Dynamically allocates a new bitmap (initially empty).
* Client is responsible for calling `roaring64_bitmap_free()`.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_create(void);
void roaring64_bitmap_free(roaring64_bitmap_t *r);
/**
* Returns a copy of a bitmap.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_copy(const roaring64_bitmap_t *r);
@@ -104,6 +106,7 @@ roaring64_bitmap_t *roaring64_bitmap_move_from_roaring32(roaring_bitmap_t *r);
/**
* Create a new bitmap containing all the values in [min, max) that are at a
* distance k*step from min.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_from_range(uint64_t min, uint64_t max,
uint64_t step);
@@ -366,6 +369,8 @@ bool roaring64_bitmap_is_strict_subset(const roaring64_bitmap_t *r1,
* bitmaps, two-by-two, it is best to start with the smallest bitmaps. You may
* also rely on roaring64_bitmap_and_inplace to avoid creating many temporary
* bitmaps.
+ *
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_and(const roaring64_bitmap_t *r1,
const roaring64_bitmap_t *r2);
@@ -410,6 +415,7 @@ double roaring64_bitmap_jaccard_index(const roaring64_bitmap_t *r1,
/**
* Computes the union between two bitmaps and returns new bitmap. The caller is
* responsible for free-ing the result.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_or(const roaring64_bitmap_t *r1,
const roaring64_bitmap_t *r2);
@@ -429,6 +435,7 @@ void roaring64_bitmap_or_inplace(roaring64_bitmap_t *r1,
/**
* Computes the symmetric difference (xor) between two bitmaps and returns a new
* bitmap. The caller is responsible for free-ing the result.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_xor(const roaring64_bitmap_t *r1,
const roaring64_bitmap_t *r2);
@@ -449,6 +456,7 @@ void roaring64_bitmap_xor_inplace(roaring64_bitmap_t *r1,
/**
* Computes the difference (andnot) between two bitmaps and returns a new
* bitmap. The caller is responsible for free-ing the result.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_andnot(const roaring64_bitmap_t *r1,
const roaring64_bitmap_t *r2);
@@ -470,6 +478,7 @@ void roaring64_bitmap_andnot_inplace(roaring64_bitmap_t *r1,
* Compute the negation of the bitmap in the interval [min, max).
* The number of negated values is `max - min`. Areas outside the range are
* passed through unchanged.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_flip(const roaring64_bitmap_t *r,
uint64_t min, uint64_t max);
@@ -478,6 +487,7 @@ roaring64_bitmap_t *roaring64_bitmap_flip(const roaring64_bitmap_t *r,
* Compute the negation of the bitmap in the interval [min, max].
* The number of negated values is `max - min + 1`. Areas outside the range are
* passed through unchanged.
+ * The returned pointer may be NULL in case of errors.
*/
roaring64_bitmap_t *roaring64_bitmap_flip_closed(const roaring64_bitmap_t *r,
uint64_t min, uint64_t max);
diff --git a/contrib/libs/croaring/src/art/art.c b/contrib/libs/croaring/src/art/art.c
index 8e54d4353e2..69b2ddcb2f8 100644
--- a/contrib/libs/croaring/src/art/art.c
+++ b/contrib/libs/croaring/src/art/art.c
@@ -237,10 +237,6 @@ static art_ref_t art_leaf_create(art_t *art, const art_key_chunk_t key[],
return art_to_ref(index, CROARING_ART_LEAF_TYPE);
}
-static inline void art_leaf_clear(art_leaf_t *leaf, art_ref_t next_free) {
- leaf->next_free = next_free;
-}
-
static art_node4_t *art_node4_create(art_t *art, const art_key_chunk_t prefix[],
uint8_t prefix_size);
static art_node16_t *art_node16_create(art_t *art,
@@ -272,11 +268,6 @@ static art_node4_t *art_node4_create(art_t *art, const art_key_chunk_t prefix[],
return node;
}
-static inline void art_node4_clear(art_node4_t *node, art_ref_t next_free) {
- node->count = 0;
- node->next_free = next_free;
-}
-
static inline art_ref_t art_node4_find_child(const art_node4_t *node,
art_key_chunk_t key) {
for (size_t i = 0; i < node->count; ++i) {
@@ -479,11 +470,6 @@ static art_node16_t *art_node16_create(art_t *art,
return node;
}
-static inline void art_node16_clear(art_node16_t *node, art_ref_t next_free) {
- node->count = 0;
- node->next_free = next_free;
-}
-
static inline art_ref_t art_node16_find_child(const art_node16_t *node,
art_key_chunk_t key) {
for (size_t i = 0; i < node->count; ++i) {
@@ -668,11 +654,6 @@ static art_node48_t *art_node48_create(art_t *art,
return node;
}
-static inline void art_node48_clear(art_node48_t *node, art_ref_t next_free) {
- node->count = 0;
- node->next_free = next_free;
-}
-
static inline art_ref_t art_node48_find_child(const art_node48_t *node,
art_key_chunk_t key) {
uint8_t val_idx = node->keys[key];
@@ -876,11 +857,6 @@ static art_node256_t *art_node256_create(art_t *art,
return node;
}
-static inline void art_node256_clear(art_node256_t *node, art_ref_t next_free) {
- node->count = 0;
- node->next_free = next_free;
-}
-
static inline art_ref_t art_node256_find_child(const art_node256_t *node,
art_key_chunk_t key) {
return node->children[key];
diff --git a/contrib/libs/croaring/src/roaring64.c b/contrib/libs/croaring/src/roaring64.c
index de1009ea2ca..0d0e818d66e 100644
--- a/contrib/libs/croaring/src/roaring64.c
+++ b/contrib/libs/croaring/src/roaring64.c
@@ -697,6 +697,7 @@ static inline bool containerptr_roaring64_bitmap_remove(roaring64_bitmap_t *r,
container_free(container2, typecode2);
bool erased = art_erase(&r->art, high48, (art_val_t *)leaf);
assert(erased);
+ (void)erased;
remove_container(r, *leaf);
return true;
}
@@ -754,6 +755,7 @@ void roaring64_bitmap_remove_bulk(roaring64_bitmap_t *r,
leaf_t leaf;
bool erased = art_erase(art, high48, (art_val_t *)&leaf);
assert(erased);
+ (void)erased;
remove_container(r, leaf);
}
} else {
@@ -798,6 +800,7 @@ static inline void remove_range_closed_at(roaring64_bitmap_t *r, art_t *art,
} else {
bool erased = art_erase(art, high48, NULL);
assert(erased);
+ (void)erased;
remove_container(r, *leaf);
}
}
@@ -837,6 +840,7 @@ void roaring64_bitmap_remove_range_closed(roaring64_bitmap_t *r, uint64_t min,
leaf_t leaf;
bool erased = art_iterator_erase(&it, (art_val_t *)&leaf);
assert(erased);
+ (void)erased;
container_free(get_container(r, leaf), get_typecode(leaf));
remove_container(r, leaf);
}
@@ -1256,6 +1260,7 @@ void roaring64_bitmap_and_inplace(roaring64_bitmap_t *r1,
leaf_t leaf;
bool erased = art_iterator_erase(&it1, (art_val_t *)&leaf);
assert(erased);
+ (void)erased;
container_free(get_container(r1, leaf), get_typecode(leaf));
remove_container(r1, leaf);
} else if (compare_result > 0) {
@@ -1556,6 +1561,7 @@ void roaring64_bitmap_xor_inplace(roaring64_bitmap_t *r1,
container_free(container2, typecode2);
bool erased = art_iterator_erase(&it1, NULL);
assert(erased);
+ (void)erased;
remove_container(r1, *leaf1);
} else {
if (container2 != container1) {
@@ -1691,6 +1697,7 @@ void roaring64_bitmap_andnot_inplace(roaring64_bitmap_t *r1,
container_free(container2, typecode2);
bool erased = art_iterator_erase(&it1, NULL);
assert(erased);
+ (void)erased;
remove_container(r1, *leaf1);
} else {
if (container2 != container1) {
@@ -1777,6 +1784,7 @@ static void roaring64_flip_leaf_inplace(roaring64_bitmap_t *r, uint8_t high48[],
} else {
bool erased = art_erase(&r->art, high48, NULL);
assert(erased);
+ (void)erased;
container_free(container2, typecode2);
remove_container(r, *leaf);
}
diff --git a/contrib/libs/croaring/ya.make b/contrib/libs/croaring/ya.make
index f77035166f0..76b204ca799 100644
--- a/contrib/libs/croaring/ya.make
+++ b/contrib/libs/croaring/ya.make
@@ -10,9 +10,9 @@ LICENSE(
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(4.3.1)
+VERSION(4.3.2)
-ORIGINAL_SOURCE(https://github.com/RoaringBitmap/CRoaring/archive/v4.3.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/RoaringBitmap/CRoaring/archive/v4.3.2.tar.gz)
ADDINCL(
GLOBAL contrib/libs/croaring/include