Skip to content

Commit 61fb4f8

Browse files
committed
updating to version 4.2.2
1 parent 7062788 commit 61fb4f8

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

Sources/CRoaring/include/roaring.h

Lines changed: 27 additions & 15 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 2024-10-04T22:14:33Z
2+
// Created by amalgamation.sh on 2025-02-24T20:10:07Z
33

44
/*
55
* The CRoaring project is under a dual license (Apache/MIT).
@@ -59,11 +59,11 @@
5959
// /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand
6060
#ifndef ROARING_INCLUDE_ROARING_VERSION
6161
#define ROARING_INCLUDE_ROARING_VERSION
62-
#define ROARING_VERSION "4.2.1"
62+
#define ROARING_VERSION "4.2.2"
6363
enum {
6464
ROARING_VERSION_MAJOR = 4,
6565
ROARING_VERSION_MINOR = 2,
66-
ROARING_VERSION_REVISION = 1
66+
ROARING_VERSION_REVISION = 2
6767
};
6868
#endif // ROARING_INCLUDE_ROARING_VERSION
6969
// clang-format on/* end file include/roaring/roaring_version.h */
@@ -86,9 +86,10 @@ enum {
8686
#ifndef CROARING_INCLUDE_PORTABILITY_H_
8787
#define CROARING_INCLUDE_PORTABILITY_H_
8888

89-
//#ifndef _GNU_SOURCE
90-
//#define _GNU_SOURCE 1
91-
//#endif // _GNU_SOURCE
89+
// Users who need _GNU_SOURCE should define it?
90+
// #ifndef _GNU_SOURCE
91+
// #define _GNU_SOURCE 1
92+
// #endif // _GNU_SOURCE
9293
#ifndef __STDC_FORMAT_MACROS
9394
#define __STDC_FORMAT_MACROS 1
9495
#endif // __STDC_FORMAT_MACROS
@@ -1072,7 +1073,8 @@ inline size_t bitset_next_set_bits(const bitset_t *bitset, size_t *buffer,
10721073
return 0; // nothing more to iterate over
10731074
}
10741075
uint64_t w = bitset->array[x];
1075-
w >>= (*startfrom & 63);
1076+
// unset low bits inside the word less than *startfrom
1077+
w &= ~((UINT64_C(1) << (*startfrom & 63)) - 1);
10761078
size_t howmany = 0;
10771079
size_t base = x << 6;
10781080
while (howmany < capacity) {
@@ -1779,11 +1781,14 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
17791781
* order. This is is guaranteed to happen when serializing an existing bitmap,
17801782
* but not for random inputs.
17811783
*
1782-
* You may use roaring_bitmap_internal_validate to check the validity of the
1783-
* bitmap prior to using it.
1784+
* If the source is untrusted, you should call
1785+
* roaring_bitmap_internal_validate to check the validity of the
1786+
* bitmap prior to using it. Only after calling roaring_bitmap_internal_validate
1787+
* is the bitmap considered safe for use.
17841788
*
1785-
* We recommend that you use checksums to check that serialized data corresponds
1786-
* to a serialized bitmap.
1789+
* We also recommend that you use checksums to check that serialized data
1790+
* corresponds to the serialized bitmap. The CRoaring library does not provide
1791+
* checksumming.
17871792
*
17881793
* This function is endian-sensitive. If you have a big-endian system (e.g., a
17891794
* mainframe IBM s390x), the data format is going to be big-endian and not
@@ -2313,6 +2318,10 @@ CROARING_DEPRECATED static inline uint32_t roaring_read_uint32_iterator(
23132318
using namespace ::roaring::api;
23142319
#endif
23152320
#endif
2321+
2322+
// roaring64 will include roaring.h, but we would
2323+
// prefer to avoid having our users include roaring64.h
2324+
// in addition to roaring.h.
23162325
/* end file include/roaring/roaring.h */
23172326
/* begin file include/roaring/memory.h */
23182327
#ifndef INCLUDE_ROARING_MEMORY_H_
@@ -2902,11 +2911,14 @@ size_t roaring64_bitmap_portable_deserialize_size(const char *buf,
29022911
* order. This is is guaranteed to happen when serializing an existing bitmap,
29032912
* but not for random inputs.
29042913
*
2905-
* You may use roaring64_bitmap_internal_validate to check the validity of the
2906-
* bitmap prior to using it.
2914+
* If the source is untrusted, you should call
2915+
* roaring64_bitmap_internal_validate to check the validity of the
2916+
* bitmap prior to using it. Only after calling
2917+
* roaring64_bitmap_internal_validate is the bitmap considered safe for use.
29072918
*
2908-
* We recommend that you use checksums to check that serialized data corresponds
2909-
* to a serialized bitmap.
2919+
* We also recommend that you use checksums to check that serialized data
2920+
* corresponds to the serialized bitmap. The CRoaring library does not provide
2921+
* checksumming.
29102922
*
29112923
* This function is endian-sensitive. If you have a big-endian system (e.g., a
29122924
* mainframe IBM s390x), the data format is going to be big-endian and not

Sources/CRoaring/roaring.c

Lines changed: 3 additions & 16 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 2024-10-04T22:14:33Z
2+
// Created by amalgamation.sh on 2025-02-24T20:10:07Z
33

44
/*
55
* The CRoaring project is under a dual license (Apache/MIT).
@@ -10418,7 +10418,7 @@ static art_val_t *art_find_at(const art_node_t *node,
1041810418
}
1041910419

1042010420
// Returns the size in bytes of the subtrie.
10421-
size_t art_size_in_bytes_at(const art_node_t *node) {
10421+
static size_t art_size_in_bytes_at(const art_node_t *node) {
1042210422
if (art_is_leaf(node)) {
1042310423
return 0;
1042410424
}
@@ -10472,7 +10472,7 @@ static void art_node_print_type(const art_node_t *node) {
1047210472
}
1047310473
}
1047410474

10475-
void art_node_printf(const art_node_t *node, uint8_t depth) {
10475+
static void art_node_printf(const art_node_t *node, uint8_t depth) {
1047610476
if (art_is_leaf(node)) {
1047710477
printf("{ type: Leaf, key: ");
1047810478
art_leaf_t *leaf = CROARING_CAST_LEAF(node);
@@ -22982,19 +22982,6 @@ roaring64_bitmap_t *roaring64_bitmap_of_ptr(size_t n_args,
2298222982
return r;
2298322983
}
2298422984

22985-
roaring64_bitmap_t *roaring64_bitmap_of(size_t n_args, ...) {
22986-
roaring64_bitmap_t *r = roaring64_bitmap_create();
22987-
roaring64_bulk_context_t context = CROARING_ZERO_INITIALIZER;
22988-
va_list ap;
22989-
va_start(ap, n_args);
22990-
for (size_t i = 0; i < n_args; i++) {
22991-
uint64_t val = va_arg(ap, uint64_t);
22992-
roaring64_bitmap_add_bulk(r, &context, val);
22993-
}
22994-
va_end(ap);
22995-
return r;
22996-
}
22997-
2299822985
static inline leaf_t *containerptr_roaring64_bitmap_add(roaring64_bitmap_t *r,
2299922986
uint8_t *high48,
2300022987
uint16_t low16,

0 commit comments

Comments
 (0)