Skip to content

Commit 87167f0

Browse files
committed
Version v4.1.3
1 parent a572ab7 commit 87167f0

File tree

3 files changed

+12
-63
lines changed

3 files changed

+12
-63
lines changed

pyroaring/croaring_version.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__croaring_version__ = "v4.1.6"
1+
__croaring_version__ = "v4.1.3"

pyroaring/roaring.c

Lines changed: 3 additions & 24 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-09-20T14:21:41Z
2+
// Created by amalgamation.sh on 2024-09-19T00:48:39Z
33

44
/*
55
* The CRoaring project is under a dual license (Apache/MIT).
@@ -22633,7 +22633,7 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize_frozen(const char *buf) {
2263322633

2263422634
bool roaring_bitmap_to_bitset(const roaring_bitmap_t *r, bitset_t *bitset) {
2263522635
uint32_t max_value = roaring_bitmap_maximum(r);
22636-
size_t new_array_size = (size_t)(max_value / 64 + 1);
22636+
size_t new_array_size = (size_t)(((uint64_t)max_value + 63) / 64);
2263722637
bool resize_ok = bitset_resize(bitset, new_array_size, true);
2263822638
if (!resize_ok) {
2263922639
return false;
@@ -24641,13 +24641,10 @@ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe(
2464124641
memcpy(&high32, buf, sizeof(high32));
2464224642
buf += sizeof(high32);
2464324643
read_bytes += sizeof(high32);
24644-
// High 32 bits must be strictly increasing.
24645-
if (high32 <= previous_high32) {
24644+
if(high32 < previous_high32) {
2464624645
roaring64_bitmap_free(r);
2464724646
return NULL;
2464824647
}
24649-
previous_high32 = high32;
24650-
2465124648
// Read the 32-bit Roaring bitmaps representing the least significant
2465224649
// bits of a set of elements.
2465324650
size_t bitmap32_size = roaring_bitmap_portable_deserialize_size(
@@ -24666,24 +24663,6 @@ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe(
2466624663
buf += bitmap32_size;
2466724664
read_bytes += bitmap32_size;
2466824665

24669-
// While we don't attempt to validate much, we must ensure that there
24670-
// is no duplication in the high 48 bits - inserting into the ART
24671-
// assumes (or UB) no duplicate keys. The top 32 bits must be unique
24672-
// because we check for strict increasing values of high32, but we
24673-
// must also ensure the top 16 bits within each 32-bit bitmap are also
24674-
// at least unique (we ensure they're strictly increasing as well,
24675-
// which they must be for a _valid_ bitmap, since it's cheaper to check)
24676-
int32_t last_bitmap_key = -1;
24677-
for (int i = 0; i < bitmap32->high_low_container.size; i++) {
24678-
uint16_t key = bitmap32->high_low_container.keys[i];
24679-
if (key <= last_bitmap_key) {
24680-
roaring_bitmap_free(bitmap32);
24681-
roaring64_bitmap_free(r);
24682-
return NULL;
24683-
}
24684-
last_bitmap_key = key;
24685-
}
24686-
2468724666
// Insert all containers of the 32-bit bitmap into the 64-bit bitmap.
2468824667
move_from_roaring32_offset(r, bitmap32, high32);
2468924668
roaring_bitmap_free(bitmap32);

pyroaring/roaring.h

Lines changed: 8 additions & 38 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-09-20T14:21:41Z
2+
// Created by amalgamation.sh on 2024-09-19T00:48:39Z
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.1.6"
62+
#define ROARING_VERSION "4.1.3"
6363
enum {
6464
ROARING_VERSION_MAJOR = 4,
6565
ROARING_VERSION_MINOR = 1,
66-
ROARING_VERSION_REVISION = 6
66+
ROARING_VERSION_REVISION = 3
6767
};
6868
#endif // ROARING_INCLUDE_ROARING_VERSION
6969
// clang-format on/* end file include/roaring/roaring_version.h */
@@ -1679,10 +1679,6 @@ size_t roaring_bitmap_shrink_to_fit(roaring_bitmap_t *r);
16791679
* This function is endian-sensitive. If you have a big-endian system (e.g., a
16801680
* mainframe IBM s390x), the data format is going to be big-endian and not
16811681
* compatible with little-endian systems.
1682-
*
1683-
* When serializing data to a file, we recommend that you also use
1684-
* checksums so that, at deserialization, you can be confident
1685-
* that you are recovering the correct data.
16861682
*/
16871683
size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf);
16881684

@@ -1746,10 +1742,7 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
17461742
* https://github.com/RoaringBitmap/RoaringFormatSpec
17471743
*
17481744
* The function itself is safe in the sense that it will not cause buffer
1749-
* overflows: it will not read beyond the scope of the provided buffer
1750-
* (buf,maxbytes).
1751-
*
1752-
* However, for correct operations, it is assumed that the bitmap
1745+
* overflows. However, for correct operations, it is assumed that the bitmap
17531746
* read was once serialized from a valid bitmap (i.e., it follows the format
17541747
* specification). If you provided an incorrect input (garbage), then the bitmap
17551748
* read may not be in a valid state and following operations may not lead to
@@ -1759,10 +1752,8 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
17591752
* but not for random inputs.
17601753
*
17611754
* You may use roaring_bitmap_internal_validate to check the validity of the
1762-
* bitmap prior to using it.
1763-
*
1764-
* We recommend that you use checksums to check that serialized data corresponds
1765-
* to a serialized bitmap.
1755+
* bitmap prior to using it. You may also use other strategies to check for
1756+
* corrupted inputs (e.g., checksums).
17661757
*
17671758
* This function is endian-sensitive. If you have a big-endian system (e.g., a
17681759
* mainframe IBM s390x), the data format is going to be big-endian and not
@@ -1824,10 +1815,6 @@ size_t roaring_bitmap_portable_size_in_bytes(const roaring_bitmap_t *r);
18241815
* This function is endian-sensitive. If you have a big-endian system (e.g., a
18251816
* mainframe IBM s390x), the data format is going to be big-endian and not
18261817
* compatible with little-endian systems.
1827-
*
1828-
* When serializing data to a file, we recommend that you also use
1829-
* checksums so that, at deserialization, you can be confident
1830-
* that you are recovering the correct data.
18311818
*/
18321819
size_t roaring_bitmap_portable_serialize(const roaring_bitmap_t *r, char *buf);
18331820

@@ -1862,10 +1849,6 @@ size_t roaring_bitmap_frozen_size_in_bytes(const roaring_bitmap_t *r);
18621849
* This function is endian-sensitive. If you have a big-endian system (e.g., a
18631850
* mainframe IBM s390x), the data format is going to be big-endian and not
18641851
* compatible with little-endian systems.
1865-
*
1866-
* When serializing data to a file, we recommend that you also use
1867-
* checksums so that, at deserialization, you can be confident
1868-
* that you are recovering the correct data.
18691852
*/
18701853
void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *r, char *buf);
18711854

@@ -2826,10 +2809,6 @@ size_t roaring64_bitmap_portable_size_in_bytes(const roaring64_bitmap_t *r);
28262809
* This function is endian-sensitive. If you have a big-endian system (e.g., a
28272810
* mainframe IBM s390x), the data format is going to be big-endian and not
28282811
* compatible with little-endian systems.
2829-
*
2830-
* When serializing data to a file, we recommend that you also use
2831-
* checksums so that, at deserialization, you can be confident
2832-
* that you are recovering the correct data.
28332812
*/
28342813
size_t roaring64_bitmap_portable_serialize(const roaring64_bitmap_t *r,
28352814
char *buf);
@@ -2844,17 +2823,14 @@ size_t roaring64_bitmap_portable_deserialize_size(const char *buf,
28442823
size_t maxbytes);
28452824

28462825
/**
2847-
* Read a bitmap from a serialized buffer (reading up to maxbytes).
2826+
* Read a bitmap from a serialized buffer safely (reading up to maxbytes).
28482827
* In case of failure, NULL is returned.
28492828
*
28502829
* This is meant to be compatible with other languages
28512830
* https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations
28522831
*
28532832
* The function itself is safe in the sense that it will not cause buffer
2854-
* overflows: it will not read beyond the scope of the provided buffer
2855-
* (buf,maxbytes).
2856-
*
2857-
* However, for correct operations, it is assumed that the bitmap
2833+
* overflows. However, for correct operations, it is assumed that the bitmap
28582834
* read was once serialized from a valid bitmap (i.e., it follows the format
28592835
* specification). If you provided an incorrect input (garbage), then the bitmap
28602836
* read may not be in a valid state and following operations may not lead to
@@ -2863,12 +2839,6 @@ size_t roaring64_bitmap_portable_deserialize_size(const char *buf,
28632839
* order. This is is guaranteed to happen when serializing an existing bitmap,
28642840
* but not for random inputs.
28652841
*
2866-
* You may use roaring64_bitmap_internal_validate to check the validity of the
2867-
* bitmap prior to using it.
2868-
*
2869-
* We recommend that you use checksums to check that serialized data corresponds
2870-
* to a serialized bitmap.
2871-
*
28722842
* This function is endian-sensitive. If you have a big-endian system (e.g., a
28732843
* mainframe IBM s390x), the data format is going to be big-endian and not
28742844
* compatible with little-endian systems.

0 commit comments

Comments
 (0)