diff --git a/Cargo.lock b/Cargo.lock index 71338ac..3993a89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,7 +205,7 @@ dependencies = [ [[package]] name = "croaring-sys" -version = "4.7.0" +version = "4.7.1" dependencies = [ "cc", ] diff --git a/README.md b/README.md index fd5664c..29649a0 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ Current documentation is available at https://docs.rs/croaring/latest/croaring/ ## CRoaring Version -This crate uses [CRoaring version `4.7.0`](https://github.com/RoaringBitmap/CRoaring/releases/tag/v4.7.0). +This crate uses [CRoaring version `4.7.1`](https://github.com/RoaringBitmap/CRoaring/releases/tag/v4.7.1). The version of this crate does not necessarily match the version of CRoaring: the major version of the crate is only incremented when there are breaking changes in the Rust API: It is possible (and has happened) that breaking changes in the CRoaring C API do not necessitate a major version bump in this crate. diff --git a/croaring-sys/CRoaring/bindgen_bundled_version.rs b/croaring-sys/CRoaring/bindgen_bundled_version.rs index fcb4a0f..d2603be 100644 --- a/croaring-sys/CRoaring/bindgen_bundled_version.rs +++ b/croaring-sys/CRoaring/bindgen_bundled_version.rs @@ -1,9 +1,9 @@ /* automatically generated by rust-bindgen 0.72.1 */ -pub const ROARING_VERSION: &[u8; 6] = b"4.7.0\0"; +pub const ROARING_VERSION: &[u8; 6] = b"4.7.1\0"; pub const ROARING_VERSION_MAJOR: _bindgen_ty_1 = 4; pub const ROARING_VERSION_MINOR: _bindgen_ty_1 = 7; -pub const ROARING_VERSION_REVISION: _bindgen_ty_1 = 0; +pub const ROARING_VERSION_REVISION: _bindgen_ty_1 = 1; pub type _bindgen_ty_1 = ::core::ffi::c_uint; extern "C" { #[doc = " result might be undefined when input_num is zero"] @@ -404,7 +404,7 @@ extern "C" { extern "C" { #[doc = " Check whether a bitmap and an open range intersect."] pub fn roaring_bitmap_intersect_with_range(bm: *const roaring_bitmap_t, x: u64, y: u64) - -> bool; + -> bool; } extern "C" { #[doc = " Computes the Jaccard index between two bitmaps. (Also known as the Tanimoto\n distance, or the Jaccard similarity coefficient)\n\n The Jaccard index is undefined if both bitmaps are empty."] @@ -641,18 +641,18 @@ extern "C" { pub fn roaring_bitmap_shrink_to_fit(r: *mut roaring_bitmap_t) -> usize; } extern "C" { - #[doc = " Write the bitmap to an output pointer, this output buffer should refer to\n at least `roaring_bitmap_size_in_bytes(r)` allocated bytes.\n\n See `roaring_bitmap_portable_serialize()` if you want a format that's\n compatible with Java and Go implementations. This format can sometimes be\n more space efficient than the portable form, e.g. when the data is sparse.\n\n Returns how many bytes written, should be `roaring_bitmap_size_in_bytes(r)`.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] + #[doc = " Write the bitmap to an output pointer, this output buffer should refer to\n at least `roaring_bitmap_size_in_bytes(r)` allocated bytes.\n\n See `roaring_bitmap_portable_serialize()` if you want a format that's\n compatible with Java and Go implementations. This format can sometimes be\n more space efficient than the portable form, e.g. when the data is sparse.\n\n Returns how many bytes written, should be `roaring_bitmap_size_in_bytes(r)`.\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] pub fn roaring_bitmap_serialize( r: *const roaring_bitmap_t, buf: *mut ::core::ffi::c_char, ) -> usize; } extern "C" { - #[doc = " Use with `roaring_bitmap_serialize()`.\n\n (See `roaring_bitmap_portable_deserialize()` if you want a format that's\n compatible with Java and Go implementations).\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n The returned pointer may be NULL in case of errors."] + #[doc = " Use with `roaring_bitmap_serialize()`.\n\n (See `roaring_bitmap_portable_deserialize()` if you want a format that's\n compatible with Java and Go implementations).\n\n The returned pointer may be NULL in case of errors."] pub fn roaring_bitmap_deserialize(buf: *const ::core::ffi::c_void) -> *mut roaring_bitmap_t; } extern "C" { - #[doc = " Use with `roaring_bitmap_serialize()`.\n\n (See `roaring_bitmap_portable_deserialize_safe()` if you want a format that's\n compatible with Java and Go implementations).\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n The difference with `roaring_bitmap_deserialize()` is that this function\n checks that the input buffer is a valid bitmap. If the buffer is too small,\n NULL is returned.\n\n The returned pointer may be NULL in case of errors."] + #[doc = " Load a bitmap from a serialized buffer safely (reading up to maxbytes).\n\n Use with `roaring_bitmap_serialize()`.\n\n (See `roaring_bitmap_portable_deserialize_safe()` if you want a format that's\n compatible with Java and Go implementations).\n\n The difference with `roaring_bitmap_deserialize()` is that this function\n is guaranteed to not read beyond the provided buffer. If the buffer is too\n small, NULL is returned.\n\n The function itself is safe in the sense that it will not cause buffer\n overflows: it will not read beyond the scope of the provided buffer\n (buf,maxbytes).\n\n However, for correct operations, it is assumed that the bitmap\n read was once serialized from a valid bitmap (i.e., it follows the format\n specification). If you provided an incorrect input (garbage), then the bitmap\n read may not be in a valid state and following operations may not lead to\n sensible results (using it may cause crashes, or it may just give incoherent\n answers). You can call roaring_bitmap_internal_validate to check the validity\n of the bitmap if the source is untrusted. Only after calling\n roaring_bitmap_internal_validate is the bitmap considered safe for use.\n\n The returned pointer may be NULL in case of errors."] pub fn roaring_bitmap_deserialize_safe( buf: *const ::core::ffi::c_void, maxbytes: usize, @@ -663,20 +663,20 @@ extern "C" { pub fn roaring_bitmap_size_in_bytes(r: *const roaring_bitmap_t) -> usize; } extern "C" { - #[doc = " Read bitmap from a serialized buffer.\n In case of failure, NULL is returned.\n\n This function is unsafe in the sense that if there is no valid serialized\n bitmap at the pointer, then many bytes could be read, possibly causing a\n buffer overflow. In other words, this routine assumes that `buf` points to a\n complete, correctly formatted serialized bitmap and does not take a buffer\n length argument that would let it enforce a read bound.\n\n Use this function only when the input buffer is already trusted, for example\n because it comes from memory that was previously filled by\n `roaring_bitmap_portable_serialize()` and whose size is known by some other\n means. If the source is untrusted, truncated, or otherwise not guaranteed to\n contain a valid serialized bitmap, prefer\n `roaring_bitmap_portable_deserialize_safe()`.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n The returned pointer may be NULL in case of errors."] + #[doc = " Read bitmap from a serialized buffer.\n In case of failure, NULL is returned.\n\n This function is unsafe in the sense that if there is no valid serialized\n bitmap at the pointer, then many bytes could be read, possibly causing a\n buffer overflow. In other words, this routine assumes that `buf` points to a\n complete, correctly formatted serialized bitmap and does not take a buffer\n length argument that would let it enforce a read bound.\n\n Use this function only when the input buffer is already trusted, for example\n because it comes from memory that was previously filled by\n `roaring_bitmap_portable_serialize()` and whose size is known by some other\n means. If the source is untrusted, truncated, or otherwise not guaranteed to\n contain a valid serialized bitmap, prefer\n `roaring_bitmap_portable_deserialize_safe()`.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n The returned pointer may be NULL in case of errors."] pub fn roaring_bitmap_portable_deserialize( buf: *const ::core::ffi::c_char, ) -> *mut roaring_bitmap_t; } extern "C" { - #[doc = " Read bitmap from a serialized buffer safely (reading up to maxbytes).\n In case of failure, NULL is returned.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n The function itself is safe in the sense that it will not cause buffer\n overflows: it will not read beyond the scope of the provided buffer\n (buf,maxbytes).\n\n However, for correct operations, it is assumed that the bitmap\n read was once serialized from a valid bitmap (i.e., it follows the format\n specification). If you provided an incorrect input (garbage), then the bitmap\n read may not be in a valid state and following operations may not lead to\n sensible results. In particular, the serialized array containers need to be\n in sorted order, and the run containers should be in sorted non-overlapping\n order. This is is guaranteed to happen when serializing an existing bitmap,\n but not for random inputs.\n\n If the source is untrusted, you should call\n roaring_bitmap_internal_validate to check the validity of the\n bitmap prior to using it. Only after calling roaring_bitmap_internal_validate\n is the bitmap considered safe for use.\n\n We also recommend that you use checksums to check that serialized data\n corresponds to the serialized bitmap. The CRoaring library does not provide\n checksumming.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n The returned pointer may be NULL in case of errors."] + #[doc = " Read bitmap from a serialized buffer safely (reading up to maxbytes).\n In case of failure, NULL is returned.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n The function itself is safe in the sense that it will not cause buffer\n overflows: it will not read beyond the scope of the provided buffer\n (buf,maxbytes).\n\n However, for correct operations, it is assumed that the bitmap\n read was once serialized from a valid bitmap (i.e., it follows the format\n specification). If you provided an incorrect input (garbage), then the bitmap\n read may not be in a valid state and following operations may not lead to\n sensible results. In particular, the serialized array containers need to be\n in sorted order, and the run containers should be in sorted non-overlapping\n order. This is is guaranteed to happen when serializing an existing bitmap,\n but not for random inputs.\n\n If the source is untrusted, you should call\n roaring_bitmap_internal_validate to check the validity of the\n bitmap prior to using it. Only after calling roaring_bitmap_internal_validate\n is the bitmap considered safe for use.\n\n We also recommend that you use checksums to check that serialized data\n corresponds to the serialized bitmap. The CRoaring library does not provide\n checksumming.\n\n The returned pointer may be NULL in case of errors."] pub fn roaring_bitmap_portable_deserialize_safe( buf: *const ::core::ffi::c_char, maxbytes: usize, ) -> *mut roaring_bitmap_t; } extern "C" { - #[doc = " Read bitmap from a serialized buffer.\n In case of failure, NULL is returned.\n\n Bitmap returned by this function can be used in all readonly contexts.\n Bitmap must be freed as usual, by calling roaring_bitmap_free().\n Underlying buffer must not be freed or modified while it backs any bitmaps.\n\n The function is unsafe in the following ways:\n 1) It may execute unaligned memory accesses.\n 2) A buffer overflow may occur if buf does not point to a valid serialized\n bitmap.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n The returned pointer may be NULL in case of errors."] + #[doc = " Read bitmap from a serialized buffer.\n In case of failure, NULL is returned.\n\n Bitmap returned by this function can be used in all readonly contexts.\n Bitmap must be freed as usual, by calling roaring_bitmap_free().\n Underlying buffer must not be freed or modified while it backs any bitmaps.\n\n The function is unsafe in the following ways:\n 1) It may execute unaligned memory accesses.\n 2) A buffer overflow may occur if buf does not point to a valid serialized\n bitmap.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems. It is not a bug, it is by design,\n since the format imitates C memory layout of roaring_bitmap_t.\n\n The returned pointer may be NULL in case of errors."] pub fn roaring_bitmap_portable_deserialize_frozen( buf: *const ::core::ffi::c_char, ) -> *mut roaring_bitmap_t; @@ -693,7 +693,7 @@ extern "C" { pub fn roaring_bitmap_portable_size_in_bytes(r: *const roaring_bitmap_t) -> usize; } extern "C" { - #[doc = " Write a bitmap to a char buffer. The output buffer should refer to at least\n `roaring_bitmap_portable_size_in_bytes(r)` bytes of allocated memory.\n\n Returns how many bytes were written which should match\n `roaring_bitmap_portable_size_in_bytes(r)`.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] + #[doc = " Write a bitmap to a char buffer. The output buffer should refer to at least\n `roaring_bitmap_portable_size_in_bytes(r)` bytes of allocated memory.\n\n Returns how many bytes were written which should match\n `roaring_bitmap_portable_size_in_bytes(r)`.\n\n This is meant to be compatible with the Java and Go versions:\n https://github.com/RoaringBitmap/RoaringFormatSpec\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] pub fn roaring_bitmap_portable_serialize( r: *const roaring_bitmap_t, buf: *mut ::core::ffi::c_char, @@ -704,14 +704,14 @@ extern "C" { pub fn roaring_bitmap_frozen_size_in_bytes(r: *const roaring_bitmap_t) -> usize; } extern "C" { - #[doc = " Serializes bitmap using frozen format.\n Buffer size must be at least roaring_bitmap_frozen_size_in_bytes().\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] + #[doc = " Serializes bitmap using frozen format.\n Buffer size must be at least roaring_bitmap_frozen_size_in_bytes().\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems. This is not a bug, it is by design,\nsince the format imitates C memory layout\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] pub fn roaring_bitmap_frozen_serialize( r: *const roaring_bitmap_t, buf: *mut ::core::ffi::c_char, ); } extern "C" { - #[doc = " Creates constant bitmap that is a view of a given buffer.\n Buffer data should have been written by `roaring_bitmap_frozen_serialize()`\n Its beginning must also be aligned by 32 bytes.\n Length must be equal exactly to `roaring_bitmap_frozen_size_in_bytes()`.\n In case of failure, NULL is returned.\n\n Bitmap returned by this function can be used in all readonly contexts.\n Bitmap must be freed as usual, by calling roaring_bitmap_free().\n Underlying buffer must not be freed or modified while it backs any bitmaps.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems."] + #[doc = " Creates constant bitmap that is a view of a given buffer.\n Buffer data should have been written by `roaring_bitmap_frozen_serialize()`\n Its beginning must also be aligned by 32 bytes.\n Length must be equal exactly to `roaring_bitmap_frozen_size_in_bytes()`.\n In case of failure, NULL is returned.\n\n Bitmap returned by this function can be used in all readonly contexts.\n Bitmap must be freed as usual, by calling roaring_bitmap_free().\n Underlying buffer must not be freed or modified while it backs any bitmaps.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems. This is not a bug, it is by design,\nsince the format imitates C memory layout of roaring_bitmap_t."] pub fn roaring_bitmap_frozen_view( buf: *const ::core::ffi::c_char, length: usize, @@ -726,6 +726,7 @@ extern "C" { ) -> bool; } extern "C" { + #[doc = " Like `roaring_iterate`, but the 32-bit values are widened to 64 bits by\n adding `high_bits` (shifted into the upper 32 bits) before being passed to\n the iterator. This is used to build 64-bit iteration on top of 32-bit\n bitmaps. `ptr` (can be NULL) is forwarded as the second argument of each\n call.\n\n Returns true if the iterator returned true throughout (so that all values\n were necessarily visited)."] pub fn roaring_iterate64( r: *const roaring_bitmap_t, iterator: roaring_iterator64, @@ -989,7 +990,7 @@ extern "C" { } extern "C" { pub fn roaring_realloc(arg1: *mut ::core::ffi::c_void, arg2: usize) - -> *mut ::core::ffi::c_void; + -> *mut ::core::ffi::c_void; } extern "C" { pub fn roaring_calloc(arg1: usize, arg2: usize) -> *mut ::core::ffi::c_void; @@ -1008,13 +1009,16 @@ extern "C" { pub struct roaring64_bitmap_s { _unused: [u8; 0], } +#[doc = " An opaque 64-bit Roaring bitmap. Create one with `roaring64_bitmap_create()`\n and release it with `roaring64_bitmap_free()`."] pub type roaring64_bitmap_t = roaring64_bitmap_s; +#[doc = " Internal leaf type, exposed only for use inside `roaring64_bulk_context_t`.\n Callers should treat it as opaque."] pub type roaring64_leaf_t = u64; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct roaring64_iterator_s { _unused: [u8; 0], } +#[doc = " An opaque iterator over a 64-bit bitmap. See `roaring64_iterator_create()`."] pub type roaring64_iterator_t = roaring64_iterator_s; #[doc = " A bit of context usable with `roaring64_bitmap_*_bulk()` functions.\n\n Should be initialized with `{0}` (or `memset()` to all zeros).\n Callers should treat it as an opaque type.\n\n A context may only be used with a single bitmap (unless re-initialized to\n zero), and any modification to a bitmap (other than modifications performed\n with `_bulk()` functions with the context passed) will invalidate any\n contexts associated with that bitmap."] #[repr(C)] @@ -1133,6 +1137,14 @@ extern "C" { max: u64, ) -> bool; } +extern "C" { + #[doc = " Returns true if all values in the range [min, max] are present."] + pub fn roaring64_bitmap_contains_range_closed( + r: *const roaring64_bitmap_t, + min: u64, + max: u64, + ) -> bool; +} extern "C" { #[doc = " Check if an item is present using context from a previous insert or search\n for faster search.\n\n `context` will be used to store information between calls to make bulk\n operations faster. `*context` should be zero-initialized before the first\n call to this function.\n\n Modifying the bitmap in any way (other than `-bulk` suffixed functions)\n will invalidate the stored context, calling this function with a non-zero\n context after doing any modification invokes undefined behavior.\n\n In order to exploit this optimization, the caller should call this function\n with values with the same high 48 bits of the value consecutively."] pub fn roaring64_bitmap_contains_bulk( @@ -1374,7 +1386,7 @@ extern "C" { pub fn roaring64_bitmap_portable_size_in_bytes(r: *const roaring64_bitmap_t) -> usize; } extern "C" { - #[doc = " Write a bitmap to a buffer. The output buffer should refer to at least\n `roaring64_bitmap_portable_size_in_bytes(r)` bytes of allocated memory.\n\n Returns how many bytes were written, which should match\n `roaring64_bitmap_portable_size_in_bytes(r)`.\n\n This is meant to be compatible with other languages:\n https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems.\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] + #[doc = " Write a bitmap to a buffer. The output buffer should refer to at least\n `roaring64_bitmap_portable_size_in_bytes(r)` bytes of allocated memory.\n\n Returns how many bytes were written, which should match\n `roaring64_bitmap_portable_size_in_bytes(r)`.\n\n This is meant to be compatible with other languages:\n https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations\n\n When serializing data to a file, we recommend that you also use\n checksums so that, at deserialization, you can be confident\n that you are recovering the correct data."] pub fn roaring64_bitmap_portable_serialize( r: *const roaring64_bitmap_t, buf: *mut ::core::ffi::c_char, @@ -1388,7 +1400,7 @@ extern "C" { ) -> usize; } extern "C" { - #[doc = " Read a bitmap from a serialized buffer (reading up to maxbytes).\n In case of failure, NULL is returned.\n\n This is meant to be compatible with other languages\n https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations\n\n The function itself is safe in the sense that it will not cause buffer\n overflows: it will not read beyond the scope of the provided buffer\n (buf,maxbytes).\n\n However, for correct operations, it is assumed that the bitmap\n read was once serialized from a valid bitmap (i.e., it follows the format\n specification). If you provided an incorrect input (garbage), then the bitmap\n read may not be in a valid state and following operations may not lead to\n sensible results. In particular, the serialized array containers need to be\n in sorted order, and the run containers should be in sorted non-overlapping\n order. This is is guaranteed to happen when serializing an existing bitmap,\n but not for random inputs.\n\n If the source is untrusted, you should call\n roaring64_bitmap_internal_validate to check the validity of the\n bitmap prior to using it. Only after calling\n roaring64_bitmap_internal_validate is the bitmap considered safe for use.\n\n We also recommend that you use checksums to check that serialized data\n corresponds to the serialized bitmap. The CRoaring library does not provide\n checksumming.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems."] + #[doc = " Read a bitmap from a serialized buffer (reading up to maxbytes).\n In case of failure, NULL is returned.\n\n This is meant to be compatible with other languages\n https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations\n\n The function itself is safe in the sense that it will not cause buffer\n overflows: it will not read beyond the scope of the provided buffer\n (buf,maxbytes).\n\n However, for correct operations, it is assumed that the bitmap\n read was once serialized from a valid bitmap (i.e., it follows the format\n specification). If you provided an incorrect input (garbage), then the bitmap\n read may not be in a valid state and following operations may not lead to\n sensible results. In particular, the serialized array containers need to be\n in sorted order, and the run containers should be in sorted non-overlapping\n order. This is is guaranteed to happen when serializing an existing bitmap,\n but not for random inputs.\n\n If the source is untrusted, you should call\n roaring64_bitmap_internal_validate to check the validity of the\n bitmap prior to using it. Only after calling\n roaring64_bitmap_internal_validate is the bitmap considered safe for use.\n\n We also recommend that you use checksums to check that serialized data\n corresponds to the serialized bitmap. The CRoaring library does not provide\n checksumming."] pub fn roaring64_bitmap_portable_deserialize_safe( buf: *const ::core::ffi::c_char, maxbytes: usize, @@ -1399,14 +1411,14 @@ extern "C" { pub fn roaring64_bitmap_frozen_size_in_bytes(r: *const roaring64_bitmap_t) -> usize; } extern "C" { - #[doc = " Serializes the bitmap in a \"frozen\" format. The given buffer must be at least\n `roaring64_bitmap_frozen_size_in_bytes()` in size. Returns the number of\n bytes used for serialization.\n\n `roaring64_bitmap_shrink_to_fit()` must be called before this method.\n\n The frozen format is optimized for speed of (de)serialization, as well as\n allowing the user to create a bitmap based on a memory mapped file, which is\n possible because the format mimics the memory layout of the bitmap.\n\n Because the format mimics the memory layout of the bitmap, the format is not\n fixed across releases of Roaring Bitmaps, and may change in future releases.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems."] + #[doc = " Serializes the bitmap in a \"frozen\" format. The given buffer must be at least\n `roaring64_bitmap_frozen_size_in_bytes()` in size. Returns the number of\n bytes used for serialization.\n\n `roaring64_bitmap_shrink_to_fit()` must be called before this method.\n\n The frozen format is optimized for speed of (de)serialization, as well as\n allowing the user to create a bitmap based on a memory mapped file, which is\n possible because the format mimics the memory layout of the bitmap.\n\n Because the format mimics the memory layout of the bitmap, the format is not\n fixed across releases of Roaring Bitmaps, and may change in future releases.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems. This is not a bug, it is by design,\n since the format imitates C memory layout of roaring64_bitmap_t."] pub fn roaring64_bitmap_frozen_serialize( r: *const roaring64_bitmap_t, buf: *mut ::core::ffi::c_char, ) -> usize; } extern "C" { - #[doc = " Creates a readonly bitmap that is a view of the given buffer. The buffer\n must be created with `roaring64_bitmap_frozen_serialize()`, and must be\n aligned by 64 bytes.\n\n Returns NULL if deserialization fails.\n\n The returned bitmap must only be used in a readonly manner. The bitmap must\n be freed using `roaring64_bitmap_free()` as normal. The backing buffer must\n only be freed after the bitmap.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems."] + #[doc = " Creates a readonly bitmap that is a view of the given buffer. The buffer\n must be created with `roaring64_bitmap_frozen_serialize()`, and must be\n aligned by 64 bytes.\n\n Returns NULL if deserialization fails.\n\n The returned bitmap must only be used in a readonly manner. The bitmap must\n be freed using `roaring64_bitmap_free()` as normal. The backing buffer must\n only be freed after the bitmap.\n\n This function is endian-sensitive. If you have a big-endian system (e.g., a\n mainframe IBM s390x), the data format is going to be big-endian and not\n compatible with little-endian systems. This is not a bug, it is by design,\n since the format imitates C memory layout of roaring64_bitmap_t."] pub fn roaring64_bitmap_frozen_view( buf: *const ::core::ffi::c_char, maxbytes: usize, @@ -1476,7 +1488,7 @@ extern "C" { extern "C" { #[doc = " Reads up to `count` values from the iterator into the given `buf`. Returns\n the number of elements read. The number of elements read can be smaller than\n `count`, which means that there are no more elements in the bitmap.\n\n This function can be used together with other iterator functions."] pub fn roaring64_iterator_read(it: *mut roaring64_iterator_t, buf: *mut u64, count: u64) - -> u64; + -> u64; } extern "C" { #[doc = " Reads previous ${count} values from iterator into user-supplied ${buf}.\n Returns the number of read elements.\n This number can be smaller than ${count}, which means that iterator is\n drained.\n\n Values are written in descending order: buf[0] is the highest (current)\n value, buf[ret-1] is the lowest value read.\n\n This function satisfies semantics of reverse iteration and can be used\n together with other iterator functions.\n - first value is copied from the current iterator value\n - after function returns, iterator is positioned at the previous element"] diff --git a/croaring-sys/CRoaring/roaring.c b/croaring-sys/CRoaring/roaring.c index 839933a..92a5c4b 100644 --- a/croaring-sys/CRoaring/roaring.c +++ b/croaring-sys/CRoaring/roaring.c @@ -1,5 +1,5 @@ // !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! -// Created by amalgamation.sh on 2026-05-12T23:23:45Z +// Created by amalgamation.sh on 2026-06-11T01:03:40Z /* * The CRoaring project is under a dual license (Apache/MIT). @@ -2625,7 +2625,6 @@ CROARING_UNTARGET_AVX512 #endif/* end file src/array_util.c */ /* begin file src/art/art.c */ #include -#include #include #include @@ -7170,7 +7169,14 @@ int32_t array_container_number_of_runs(const array_container_t *ac) { * */ int32_t array_container_write(const array_container_t *container, char *buf) { +#if CROARING_IS_BIG_ENDIAN + for (int32_t i = 0; i < container->cardinality; ++i) { + uint16_t v_le = croaring_htole16(container->array[i]); + memcpy(buf + i * sizeof(uint16_t), &v_le, sizeof(uint16_t)); + } +#else memcpy(buf, container->array, container->cardinality * sizeof(uint16_t)); +#endif return array_container_size_in_bytes(container); } @@ -7203,7 +7209,15 @@ int32_t array_container_read(int32_t cardinality, array_container_t *container, array_container_grow(container, cardinality, false); } container->cardinality = cardinality; +#if CROARING_IS_BIG_ENDIAN + for (int32_t i = 0; i < cardinality; ++i) { + uint16_t v_le; + memcpy(&v_le, buf + i * sizeof(uint16_t), sizeof(uint16_t)); + container->array[i] = croaring_letoh16(v_le); + } +#else memcpy(container->array, buf, container->cardinality * sizeof(uint16_t)); +#endif return array_container_size_in_bytes(container); } @@ -8275,7 +8289,14 @@ int bitset_container_number_of_runs(bitset_container_t *bc) { int32_t bitset_container_write(const bitset_container_t *container, char *buf) { +#if CROARING_IS_BIG_ENDIAN + for (int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i) { + uint64_t w_le = croaring_htole64(container->words[i]); + memcpy(buf + i * sizeof(uint64_t), &w_le, sizeof(uint64_t)); + } +#else memcpy(buf, container->words, BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t)); +#endif return bitset_container_size_in_bytes(container); } @@ -8283,7 +8304,15 @@ int32_t bitset_container_write(const bitset_container_t *container, int32_t bitset_container_read(int32_t cardinality, bitset_container_t *container, const char *buf) { container->cardinality = cardinality; +#if CROARING_IS_BIG_ENDIAN + for (int32_t i = 0; i < BITSET_CONTAINER_SIZE_IN_WORDS; ++i) { + uint64_t w_le; + memcpy(&w_le, buf + i * sizeof(uint64_t), sizeof(uint64_t)); + container->words[i] = croaring_letoh64(w_le); + } +#else memcpy(container->words, buf, BITSET_CONTAINER_SIZE_IN_WORDS * sizeof(uint64_t)); +#endif return bitset_container_size_in_bytes(container); } @@ -12942,9 +12971,21 @@ bool run_container_validate(const run_container_t *run, const char **reason) { int32_t run_container_write(const run_container_t *container, char *buf) { uint16_t cast_16 = container->n_runs; - memcpy(buf, &cast_16, sizeof(uint16_t)); + uint16_t n_runs_le = croaring_htole16(cast_16); + memcpy(buf, &n_runs_le, sizeof(uint16_t)); +#if CROARING_IS_BIG_ENDIAN + char *out = buf + sizeof(uint16_t); + for (int32_t i = 0; i < container->n_runs; ++i) { + uint16_t v_le = croaring_htole16(container->runs[i].value); + uint16_t l_le = croaring_htole16(container->runs[i].length); + memcpy(out, &v_le, sizeof(uint16_t)); + memcpy(out + sizeof(uint16_t), &l_le, sizeof(uint16_t)); + out += sizeof(rle16_t); + } +#else memcpy(buf + sizeof(uint16_t), container->runs, container->n_runs * sizeof(rle16_t)); +#endif return run_container_size_in_bytes(container); } @@ -12953,12 +12994,24 @@ int32_t run_container_read(int32_t cardinality, run_container_t *container, (void)cardinality; uint16_t cast_16; memcpy(&cast_16, buf, sizeof(uint16_t)); - container->n_runs = cast_16; + container->n_runs = croaring_letoh16(cast_16); if (container->n_runs > container->capacity) run_container_grow(container, container->n_runs, false); if (container->n_runs > 0) { +#if CROARING_IS_BIG_ENDIAN + const char *in = buf + sizeof(uint16_t); + for (int32_t i = 0; i < container->n_runs; ++i) { + uint16_t v_le, l_le; + memcpy(&v_le, in, sizeof(uint16_t)); + memcpy(&l_le, in + sizeof(uint16_t), sizeof(uint16_t)); + container->runs[i].value = croaring_letoh16(v_le); + container->runs[i].length = croaring_letoh16(l_le); + in += sizeof(rle16_t); + } +#else memcpy(container->runs, buf + sizeof(uint16_t), container->n_runs * sizeof(rle16_t)); +#endif } return run_container_size_in_bytes(container); } @@ -14237,15 +14290,17 @@ size_t ra_portable_size_in_bytes(const roaring_array_t *ra) { return count; } -// This function is endian-sensitive. +// The portable serialization format is little-endian. On big-endian hosts we +// byte-swap multi-byte fields before writing them to the buffer. size_t ra_portable_serialize(const roaring_array_t *ra, char *buf) { char *initbuf = buf; uint32_t startOffset = 0; bool hasrun = ra_has_run_container(ra); if (hasrun) { uint32_t cookie = SERIAL_COOKIE | ((uint32_t)(ra->size - 1) << 16); - memcpy(buf, &cookie, sizeof(cookie)); - buf += sizeof(cookie); + uint32_t cookie_le = croaring_htole32(cookie); + memcpy(buf, &cookie_le, sizeof(cookie_le)); + buf += sizeof(cookie_le); uint32_t s = (ra->size + 7) / 8; memset(buf, 0, s); for (int32_t i = 0; i < ra->size; ++i) { @@ -14262,30 +14317,34 @@ size_t ra_portable_serialize(const roaring_array_t *ra, char *buf) { } } else { // backwards compatibility uint32_t cookie = SERIAL_COOKIE_NO_RUNCONTAINER; - - memcpy(buf, &cookie, sizeof(cookie)); - buf += sizeof(cookie); - memcpy(buf, &ra->size, sizeof(ra->size)); - buf += sizeof(ra->size); + uint32_t cookie_le = croaring_htole32(cookie); + memcpy(buf, &cookie_le, sizeof(cookie_le)); + buf += sizeof(cookie_le); + uint32_t size_le = croaring_htole32((uint32_t)ra->size); + memcpy(buf, &size_le, sizeof(size_le)); + buf += sizeof(size_le); startOffset = 4 + 4 + 4 * ra->size + 4 * ra->size; } for (int32_t k = 0; k < ra->size; ++k) { - memcpy(buf, &ra->keys[k], sizeof(ra->keys[k])); - buf += sizeof(ra->keys[k]); + uint16_t key_le = croaring_htole16(ra->keys[k]); + memcpy(buf, &key_le, sizeof(key_le)); + buf += sizeof(key_le); // get_cardinality returns a value in [1,1<<16], subtracting one // we get [0,1<<16 - 1] which fits in 16 bits uint16_t card = (uint16_t)(container_get_cardinality(ra->containers[k], ra->typecodes[k]) - 1); - memcpy(buf, &card, sizeof(card)); - buf += sizeof(card); + uint16_t card_le = croaring_htole16(card); + memcpy(buf, &card_le, sizeof(card_le)); + buf += sizeof(card_le); } if ((!hasrun) || (ra->size >= NO_OFFSET_THRESHOLD)) { // writing the containers offsets for (int32_t k = 0; k < ra->size; k++) { - memcpy(buf, &startOffset, sizeof(startOffset)); - buf += sizeof(startOffset); + uint32_t off_le = croaring_htole32(startOffset); + memcpy(buf, &off_le, sizeof(off_le)); + buf += sizeof(off_le); startOffset = startOffset + container_size_in_bytes(ra->containers[k], ra->typecodes[k]); @@ -14309,6 +14368,7 @@ size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) { if (bytestotal > maxbytes) return 0; uint32_t cookie; memcpy(&cookie, buf, sizeof(int32_t)); + cookie = croaring_letoh32(cookie); buf += sizeof(uint32_t); if ((cookie & 0xFFFF) != SERIAL_COOKIE && cookie != SERIAL_COOKIE_NO_RUNCONTAINER) { @@ -14321,7 +14381,9 @@ size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) { else { bytestotal += sizeof(int32_t); if (bytestotal > maxbytes) return 0; - memcpy(&size, buf, sizeof(int32_t)); + uint32_t size_le; + memcpy(&size_le, buf, sizeof(int32_t)); + size = (int32_t)croaring_letoh32(size_le); buf += sizeof(uint32_t); } if (size > (1 << 16) || size < 0) { @@ -14350,6 +14412,7 @@ size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) { for (int32_t k = 0; k < size; ++k) { uint16_t tmp; memcpy(&tmp, keyscards + 4 * k + 2, sizeof(tmp)); + tmp = croaring_letoh16(tmp); uint32_t thiscard = tmp + 1; bool isbitmap = (thiscard > DEFAULT_MAX_SIZE); bool isrun = false; @@ -14370,6 +14433,7 @@ size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) { if (bytestotal > maxbytes) return 0; uint16_t n_runs; memcpy(&n_runs, buf, sizeof(uint16_t)); + n_runs = croaring_letoh16(n_runs); buf += sizeof(uint16_t); size_t containersize = n_runs * sizeof(rle16_t); bytestotal += containersize; @@ -14390,7 +14454,8 @@ size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) { // cannot be found. If it returns true, readbytes is populated by how many bytes // were read, we have that *readbytes <= maxbytes. // -// This function is endian-sensitive. +// The portable serialization format is little-endian. On big-endian hosts we +// byte-swap multi-byte fields after reading them from the buffer. bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, const size_t maxbytes, size_t *readbytes) { *readbytes = sizeof(int32_t); // for cookie @@ -14400,6 +14465,7 @@ bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, } uint32_t cookie; memcpy(&cookie, buf, sizeof(int32_t)); + cookie = croaring_letoh32(cookie); buf += sizeof(uint32_t); if ((cookie & 0xFFFF) != SERIAL_COOKIE && cookie != SERIAL_COOKIE_NO_RUNCONTAINER) { @@ -14416,7 +14482,9 @@ bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, // Ran out of bytes while reading second part of the cookie. return false; } - memcpy(&size, buf, sizeof(int32_t)); + uint32_t size_le; + memcpy(&size_le, buf, sizeof(int32_t)); + size = (int32_t)croaring_letoh32(size_le); buf += sizeof(uint32_t); } if (size < 0) { @@ -14458,7 +14526,7 @@ bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, for (int32_t k = 0; k < size; ++k) { uint16_t tmp; memcpy(&tmp, keyscards + 4 * k, sizeof(tmp)); - answer->keys[k] = tmp; + answer->keys[k] = croaring_letoh16(tmp); } if ((!hasrun) || (size >= NO_OFFSET_THRESHOLD)) { *readbytes += size * 4; @@ -14476,6 +14544,7 @@ bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, for (int32_t k = 0; k < size; ++k) { uint16_t tmp; memcpy(&tmp, keyscards + 4 * k + 2, sizeof(tmp)); + tmp = croaring_letoh16(tmp); uint32_t thiscard = tmp + 1; bool isbitmap = (thiscard > DEFAULT_MAX_SIZE); bool isrun = false; @@ -14519,6 +14588,7 @@ bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, } uint16_t n_runs; memcpy(&n_runs, buf, sizeof(uint16_t)); + n_runs = croaring_letoh16(n_runs); size_t containersize = n_runs * sizeof(rle16_t); *readbytes += containersize; if (*readbytes > maxbytes) { // data is corrupted? @@ -16344,9 +16414,18 @@ size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf) { return roaring_bitmap_portable_serialize(r, buf + 1) + 1; } else { buf[0] = CROARING_SERIALIZATION_ARRAY_UINT32; - memcpy(buf + 1, &cardinality, sizeof(uint32_t)); - roaring_bitmap_to_uint32_array( - r, (uint32_t *)(buf + 1 + sizeof(uint32_t))); + uint32_t card_le = croaring_htole32((uint32_t)cardinality); + memcpy(buf + 1, &card_le, sizeof(uint32_t)); + uint32_t *out = (uint32_t *)(buf + 1 + sizeof(uint32_t)); + roaring_bitmap_to_uint32_array(r, out); +#if CROARING_IS_BIG_ENDIAN + for (uint64_t i = 0; i < cardinality; ++i) { + uint32_t v; + memcpy(&v, out + i, sizeof(uint32_t)); + v = croaring_htole32(v); + memcpy(out + i, &v, sizeof(uint32_t)); + } +#endif return 1 + (size_t)sizeasarray; } } @@ -16405,6 +16484,7 @@ roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf) { uint32_t card; memcpy(&card, bufaschar + 1, sizeof(uint32_t)); + card = croaring_letoh32(card); const uint32_t *elems = (const uint32_t *)(bufaschar + 1 + sizeof(uint32_t)); @@ -16418,6 +16498,7 @@ roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf) { // elems may not be aligned, read with memcpy uint32_t elem; memcpy(&elem, elems + i, sizeof(elem)); + elem = croaring_letoh32(elem); roaring_bitmap_add_bulk(bitmap, &context, elem); } return bitmap; @@ -16443,6 +16524,7 @@ roaring_bitmap_t *roaring_bitmap_deserialize_safe(const void *buf, /* This looks like a compressed set of uint32_t elements */ uint32_t card; memcpy(&card, bufaschar + 1, sizeof(uint32_t)); + card = croaring_letoh32(card); // Check the buffer is big enough to contain card uint32_t elements if (maxbytes < 1 + sizeof(uint32_t) + card * sizeof(uint32_t)) { @@ -16461,6 +16543,7 @@ roaring_bitmap_t *roaring_bitmap_deserialize_safe(const void *buf, // elems may not be aligned, read with memcpy uint32_t elem; memcpy((char *)&elem, (char *)(elems + i), sizeof(elem)); + elem = croaring_letoh32(elem); roaring_bitmap_add_bulk(bitmap, &context, elem); } return bitmap; @@ -18392,7 +18475,6 @@ bool roaring_bitmap_to_bitset(const roaring_bitmap_t *r, bitset_t *bitset) { /* end file src/roaring.c */ /* begin file src/roaring64.c */ #include -#include #include #include #include @@ -18946,12 +19028,20 @@ bool roaring64_bitmap_contains_range(const roaring64_bitmap_t *r, uint64_t min, if (min >= max) { return true; } + return roaring64_bitmap_contains_range_closed(r, min, max - 1); +} + +bool roaring64_bitmap_contains_range_closed(const roaring64_bitmap_t *r, + uint64_t min, uint64_t max) { + if (min > max) { + return true; + } uint8_t min_high48[ART_KEY_BYTES]; uint16_t min_low16 = split_key(min, min_high48); uint8_t max_high48[ART_KEY_BYTES]; uint16_t max_low16 = split_key(max, max_high48); - uint64_t max_high48_bits = (max - 1) & 0xFFFFFFFFFFFF0000; // Inclusive + uint64_t max_high48_bits = max & 0xFFFFFFFFFFFF0000; art_iterator_t it = art_lower_bound((art_t *)&r->art, min_high48); if (it.value == NULL || combine_key(it.key, 0) > min) { @@ -18977,7 +19067,7 @@ bool roaring64_bitmap_contains_range(const roaring64_bitmap_t *r, uint64_t min, } uint32_t container_max = 0xFFFF + 1; // Exclusive if (compare_high48(it.key, max_high48) == 0) { - container_max = max_low16; + container_max = (uint32_t)max_low16 + 1; } // For the first and last containers we use container_contains_range, @@ -20559,7 +20649,8 @@ size_t roaring64_bitmap_portable_serialize(const roaring64_bitmap_t *r, // Write as uint64 the distinct number of "buckets", where a bucket is // defined as the most significant 32 bits of an element. uint64_t high32_count = count_high32(r); - memcpy(buf, &high32_count, sizeof(high32_count)); + uint64_t high32_count_le = croaring_htole64(high32_count); + memcpy(buf, &high32_count_le, sizeof(high32_count_le)); buf += sizeof(high32_count); art_iterator_t it = art_init_iterator((art_t *)&r->art, /*first=*/true); @@ -20574,7 +20665,8 @@ size_t roaring64_bitmap_portable_serialize(const roaring64_bitmap_t *r, if (bitmap32 != NULL) { // Write as uint32 the most significant 32 bits of the // bucket. - memcpy(buf, &prev_high32, sizeof(prev_high32)); + uint32_t prev_high32_le = croaring_htole32(prev_high32); + memcpy(buf, &prev_high32_le, sizeof(prev_high32_le)); buf += sizeof(prev_high32); // Write the 32-bit Roaring bitmaps representing the least @@ -20605,7 +20697,8 @@ size_t roaring64_bitmap_portable_serialize(const roaring64_bitmap_t *r, if (bitmap32 != NULL) { // Write as uint32 the most significant 32 bits of the bucket. - memcpy(buf, &prev_high32, sizeof(prev_high32)); + uint32_t prev_high32_le = croaring_htole32(prev_high32); + memcpy(buf, &prev_high32_le, sizeof(prev_high32_le)); buf += sizeof(prev_high32); // Write the 32-bit Roaring bitmaps representing the least @@ -20632,6 +20725,7 @@ size_t roaring64_bitmap_portable_deserialize_size(const char *buf, return 0; } memcpy(&buckets, buf, sizeof(buckets)); + buckets = croaring_letoh64(buckets); buf += sizeof(buckets); read_bytes += sizeof(buckets); @@ -20678,6 +20772,7 @@ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe( return NULL; } memcpy(&buckets, buf, sizeof(buckets)); + buckets = croaring_letoh64(buckets); buf += sizeof(buckets); read_bytes += sizeof(buckets); @@ -20697,6 +20792,7 @@ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe( return NULL; } memcpy(&high32, buf, sizeof(high32)); + high32 = croaring_letoh32(high32); buf += sizeof(high32); read_bytes += sizeof(high32); // High 32 bits must be strictly increasing. diff --git a/croaring-sys/CRoaring/roaring.h b/croaring-sys/CRoaring/roaring.h index bb620ec..57bc308 100644 --- a/croaring-sys/CRoaring/roaring.h +++ b/croaring-sys/CRoaring/roaring.h @@ -1,5 +1,5 @@ // !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! -// Created by amalgamation.sh on 2026-05-12T23:23:45Z +// Created by amalgamation.sh on 2026-06-11T01:03:40Z /* * The CRoaring project is under a dual license (Apache/MIT). @@ -59,11 +59,11 @@ // /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand #ifndef ROARING_INCLUDE_ROARING_VERSION #define ROARING_INCLUDE_ROARING_VERSION -#define ROARING_VERSION "4.7.0" +#define ROARING_VERSION "4.7.1" enum { ROARING_VERSION_MAJOR = 4, ROARING_VERSION_MINOR = 7, - ROARING_VERSION_REVISION = 0 + ROARING_VERSION_REVISION = 1 }; #endif // ROARING_INCLUDE_ROARING_VERSION // clang-format on/* end file include/roaring/roaring_version.h */ @@ -85,7 +85,7 @@ enum { /** * All macros should be prefixed with either CROARING or ROARING. * The library uses both ROARING_... - * as well as CROAIRING_ as prefixes. The ROARING_ prefix is for + * as well as CROARING_ as prefixes. The ROARING_ prefix is for * macros that are provided by the build system or that are closely * related to the format. The header macros may also use ROARING_. * The CROARING_ prefix is for internal macros that a user is unlikely @@ -134,6 +134,12 @@ enum { #ifdef __GLIBC__ #include // this should never be needed but there are some reports that it is needed. #endif +// alignas/alignof are keywords in C++ and in C23+, where is +// deprecated. Only include it for C11..C17. +#if !defined(__cplusplus) && \ + (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L) +#include +#endif #ifdef __cplusplus extern "C" { // portability definitions are in global scope, not a namespace @@ -532,6 +538,55 @@ static inline int roaring_hamming(uint64_t x) { #define croaring_be64toh(x) croaring_htobe64(x) // End of host <-> big endian conversion. +// Host <-> little-endian conversion helpers. +// +// The CRoaring "portable" serialization format (and the regular +// roaring_bitmap_serialize / Roaring64Map::write formats which build on it) +// is defined to be little-endian on the wire. Code that reads or writes +// multi-byte integers to such buffers must convert between host and +// little-endian byte order. On little-endian hosts these are no-ops; on +// big-endian hosts they swap bytes. +// +// The "frozen" format is intentionally non-portable and uses native byte +// order; it must not use these helpers. +#if CROARING_IS_BIG_ENDIAN + +static inline uint16_t croaring_bswap16(uint16_t x) { + return (uint16_t)((x << 8) | (x >> 8)); +} + +static inline uint32_t croaring_bswap32(uint32_t x) { + return ((x & 0x000000FFU) << 24) | ((x & 0x0000FF00U) << 8) | + ((x & 0x00FF0000U) >> 8) | ((x & 0xFF000000U) >> 24); +} + +static inline uint64_t croaring_bswap64(uint64_t x) { + return ((x & 0x00000000000000FFULL) << 56) | + ((x & 0x000000000000FF00ULL) << 40) | + ((x & 0x0000000000FF0000ULL) << 24) | + ((x & 0x00000000FF000000ULL) << 8) | + ((x & 0x000000FF00000000ULL) >> 8) | + ((x & 0x0000FF0000000000ULL) >> 24) | + ((x & 0x00FF000000000000ULL) >> 40) | + ((x & 0xFF00000000000000ULL) >> 56); +} + +#define croaring_htole16(x) croaring_bswap16(x) +#define croaring_htole32(x) croaring_bswap32(x) +#define croaring_htole64(x) croaring_bswap64(x) + +#else // CROARING_IS_BIG_ENDIAN + +#define croaring_htole16(x) (x) +#define croaring_htole32(x) (x) +#define croaring_htole64(x) (x) + +#endif // CROARING_IS_BIG_ENDIAN + +#define croaring_letoh16(x) croaring_htole16(x) +#define croaring_letoh32(x) croaring_htole32(x) +#define croaring_letoh64(x) croaring_htole64(x) + // Defines for the possible CROARING atomic implementations #define CROARING_ATOMIC_IMPL_NONE 1 #define CROARING_ATOMIC_IMPL_CPP 2 @@ -547,13 +602,13 @@ static inline int roaring_hamming(uint64_t x) { #define CROARING_ATOMIC_IMPL CROARING_ATOMIC_IMPL_CPP #endif //__has_include() #else - // We lack __has_include to check: +// We lack __has_include to check: #define CROARING_ATOMIC_IMPL CROARING_ATOMIC_IMPL_CPP #endif //__has_include #elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) #define CROARING_ATOMIC_IMPL CROARING_ATOMIC_IMPL_C #elif CROARING_REGULAR_VISUAL_STUDIO - // https://www.technetworkhub.com/c11-atomics-in-visual-studio-2022-version-17/ +// https://www.technetworkhub.com/c11-atomics-in-visual-studio-2022-version-17/ #define CROARING_ATOMIC_IMPL CROARING_ATOMIC_IMPL_C_WINDOWS #endif #endif // !defined(CROARING_ATOMIC_IMPL) @@ -8789,10 +8844,6 @@ size_t roaring_bitmap_shrink_to_fit(roaring_bitmap_t *r); * * Returns how many bytes written, should be `roaring_bitmap_size_in_bytes(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. - * * When serializing data to a file, we recommend that you also use * checksums so that, at deserialization, you can be confident * that you are recovering the correct data. @@ -8805,27 +8856,34 @@ size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf); * (See `roaring_bitmap_portable_deserialize()` if you want a format that's * compatible with Java and Go implementations). * - * 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); /** + * Load a bitmap from a serialized buffer safely (reading up to maxbytes). + * * Use with `roaring_bitmap_serialize()`. * * (See `roaring_bitmap_portable_deserialize_safe()` if you want a format that's * compatible with Java and Go implementations). * - * 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 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. + * is guaranteed to not read beyond the provided buffer. If the buffer is too + * small, NULL is returned. + * + * The function itself is safe in the sense that it will not cause buffer + * overflows: it will not read beyond the scope of the provided buffer + * (buf,maxbytes). + * + * However, for correct operations, it is assumed that the bitmap + * read was once serialized from a valid bitmap (i.e., it follows the format + * specification). If you provided an incorrect input (garbage), then the bitmap + * read may not be in a valid state and following operations may not lead to + * sensible results (using it may cause crashes, or it may just give incoherent + * answers). You can call roaring_bitmap_internal_validate to check the validity + * of the bitmap if the source is untrusted. Only after calling + * roaring_bitmap_internal_validate is the bitmap considered safe for use. * * The returned pointer may be NULL in case of errors. */ @@ -8858,10 +8916,6 @@ size_t roaring_bitmap_size_in_bytes(const roaring_bitmap_t *r); * This is meant to be compatible with the Java and Go versions: * https://github.com/RoaringBitmap/RoaringFormatSpec * - * 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); @@ -8895,10 +8949,6 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf); * corresponds to the serialized bitmap. The CRoaring library does not provide * checksumming. * - * 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, @@ -8922,7 +8972,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. + * compatible with little-endian systems. It is not a bug, it is by design, + * since the format imitates C memory layout of roaring_bitmap_t. * * The returned pointer may be NULL in case of errors. */ @@ -8956,10 +9007,6 @@ size_t roaring_bitmap_portable_size_in_bytes(const roaring_bitmap_t *r); * This is meant to be compatible with the Java and Go versions: * https://github.com/RoaringBitmap/RoaringFormatSpec * - * 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. - * * When serializing data to a file, we recommend that you also use * checksums so that, at deserialization, you can be confident * that you are recovering the correct data. @@ -8996,7 +9043,8 @@ size_t roaring_bitmap_frozen_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. + * compatible with little-endian systems. This is not a bug, it is by design, + *since the format imitates C memory layout * * When serializing data to a file, we recommend that you also use * checksums so that, at deserialization, you can be confident @@ -9017,7 +9065,8 @@ void roaring_bitmap_frozen_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. + * compatible with little-endian systems. This is not a bug, it is by design, + *since the format imitates C memory layout of roaring_bitmap_t. */ const roaring_bitmap_t *roaring_bitmap_frozen_view(const char *buf, size_t length); @@ -9038,6 +9087,16 @@ const roaring_bitmap_t *roaring_bitmap_frozen_view(const char *buf, bool roaring_iterate(const roaring_bitmap_t *r, roaring_iterator iterator, void *ptr); +/** + * Like `roaring_iterate`, but the 32-bit values are widened to 64 bits by + * adding `high_bits` (shifted into the upper 32 bits) before being passed to + * the iterator. This is used to build 64-bit iteration on top of 32-bit + * bitmaps. `ptr` (can be NULL) is forwarded as the second argument of each + * call. + * + * Returns true if the iterator returned true throughout (so that all values + * were necessarily visited). + */ bool roaring_iterate64(const roaring_bitmap_t *r, roaring_iterator64 iterator, uint64_t high_bits, void *ptr); @@ -9611,8 +9670,14 @@ namespace roaring { namespace api { #endif +/** An opaque 64-bit Roaring bitmap. Create one with `roaring64_bitmap_create()` + * and release it with `roaring64_bitmap_free()`. */ typedef struct roaring64_bitmap_s roaring64_bitmap_t; +/** Internal leaf type, exposed only for use inside `roaring64_bulk_context_t`. + * Callers should treat it as opaque. */ typedef uint64_t roaring64_leaf_t; +/** An opaque iterator over a 64-bit bitmap. See `roaring64_iterator_create()`. + */ typedef struct roaring64_iterator_s roaring64_iterator_t; /** @@ -9837,6 +9902,12 @@ bool roaring64_bitmap_contains(const roaring64_bitmap_t *r, uint64_t val); bool roaring64_bitmap_contains_range(const roaring64_bitmap_t *r, uint64_t min, uint64_t max); +/** + * Returns true if all values in the range [min, max] are present. + */ +bool roaring64_bitmap_contains_range_closed(const roaring64_bitmap_t *r, + uint64_t min, uint64_t max); + /** * Check if an item is present using context from a previous insert or search * for faster search. @@ -10169,10 +10240,6 @@ size_t roaring64_bitmap_portable_size_in_bytes(const roaring64_bitmap_t *r); * This is meant to be compatible with other languages: * https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations * - * 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. - * * When serializing data to a file, we recommend that you also use * checksums so that, at deserialization, you can be confident * that you are recovering the correct data. @@ -10217,10 +10284,6 @@ size_t roaring64_bitmap_portable_deserialize_size(const char *buf, * We also recommend that you use checksums to check that serialized data * corresponds to the serialized bitmap. The CRoaring library does not provide * checksumming. - * - * 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. */ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe(const char *buf, size_t maxbytes); @@ -10249,7 +10312,8 @@ size_t roaring64_bitmap_frozen_size_in_bytes(const roaring64_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. + * compatible with little-endian systems. This is not a bug, it is by design, + * since the format imitates C memory layout of roaring64_bitmap_t. */ size_t roaring64_bitmap_frozen_serialize(const roaring64_bitmap_t *r, char *buf); @@ -10267,7 +10331,8 @@ size_t roaring64_bitmap_frozen_serialize(const roaring64_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. + * compatible with little-endian systems. This is not a bug, it is by design, + * since the format imitates C memory layout of roaring64_bitmap_t. */ roaring64_bitmap_t *roaring64_bitmap_frozen_view(const char *buf, size_t maxbytes); diff --git a/croaring-sys/CRoaring/roaring.hh b/croaring-sys/CRoaring/roaring.hh index 090b0cf..e10c646 100644 --- a/croaring-sys/CRoaring/roaring.hh +++ b/croaring-sys/CRoaring/roaring.hh @@ -1,5 +1,5 @@ // !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! -// Created by amalgamation.sh on 2026-05-12T23:23:45Z +// Created by amalgamation.sh on 2026-06-11T01:03:40Z /* * The CRoaring project is under a dual license (Apache/MIT). @@ -340,6 +340,28 @@ class Roaring { return api::roaring_bitmap_remove_range_closed(&roaring, min, max); } + /** + * Keep only values in the half-open interval [min, max). + * Equivalent to two consecutive removeRange calls. + */ + void mask(uint64_t min, uint64_t max) noexcept { + removeRange(0, min); + if (!isEmpty()) { + removeRange(max, (uint64_t)maximum() + 1); + } + } + + /** + * Keep only values in the closed interval [min, max]. + * Equivalent to two consecutive removeRangeClosed calls. + */ + void maskClosed(uint32_t min, uint32_t max) noexcept { + if (min > 0) removeRangeClosed(0, min - 1); + if (!isEmpty() && max < maximum()) { + removeRangeClosed(max + 1, maximum()); + } + } + /** * Clears the bitmap. */ @@ -373,6 +395,9 @@ class Roaring { return api::roaring_bitmap_contains_range(&roaring, x, y); } + /** + * Check if all values from x (included) to y (included) are present. + */ bool containsRangeClosed(const uint32_t x, const uint32_t y) const noexcept { return api::roaring_bitmap_contains_range_closed(&roaring, x, y); @@ -475,7 +500,10 @@ class Roaring { api::roaring_bitmap_to_uint32_array(&roaring, ans); } /** - * To int array with pagination + * Write to "ans" a sorted slice of the bitmap's values: skip the first + * "offset" values and copy up to "limit" of the values that follow. This + * is the paginated form of toUint32Array(). The caller must ensure that + * "ans" has room for at least "limit" values. */ void rangeUint32Array(uint32_t *ans, size_t offset, size_t limit) const noexcept { @@ -696,7 +724,7 @@ class Roaring { * many, many bytes could be read. See also readSafe. * * The function may throw std::runtime_error if a bitmap could not be read. - * Not that even if it does not throw, the bitmap could still be unusable if + * Note that even if it does not throw, the bitmap could still be unusable if * the loaded data does not match the portable Roaring specification: you * should ensure that the data you load come from a serialized bitmap. */ @@ -729,7 +757,7 @@ class Roaring { * method). * * The function may throw std::runtime_error if a bitmap could not be read. - * Not that even if it does not throw, the bitmap could still be unusable if + * Note that even if it does not throw, the bitmap could still be unusable if * the loaded data does not match the portable Roaring specification: you * should ensure that the data you load come from a serialized bitmap. */ @@ -1609,7 +1637,82 @@ class Roaring64Map { return iter->second.contains(lowBytes(x)); } - // TODO: implement `containsRange` + /** + * Returns true if all values in the half-open interval [min, max) are + * present. + */ + bool containsRange(uint64_t min, uint64_t max) const { + if (min >= max) { + return true; + } + return containsRangeClosed(min, max - 1); + } + + /** + * Returns true if all values in the closed interval [min, max] are present. + */ + bool containsRangeClosed(uint32_t min, uint32_t max) const { + auto iter = roarings.find(0); + if (iter == roarings.end()) { + return min > max; + } + return iter->second.containsRangeClosed(min, max); + } + + /** + * Returns true if all values in the closed interval [min, max] are present. + */ + bool containsRangeClosed(uint64_t min, uint64_t max) const { + if (min > max) { + return true; + } + uint32_t start_high = highBytes(min); + uint32_t start_low = lowBytes(min); + uint32_t end_high = highBytes(max); + uint32_t end_low = lowBytes(max); + + // We put std::numeric_limits<>::max in parentheses to avoid a + // clash with the Windows.h header under Windows. + const uint32_t uint32_max = (std::numeric_limits::max)(); + + // If start == end, check it in one call. + if (start_high == end_high) { + auto iter = roarings.find(start_high); + if (iter == roarings.end()) { + return false; + } + return iter->second.containsRangeClosed(start_low, end_low); + } + + // Otherwise the range spans multiple bitmaps. + auto iter = roarings.find(start_high); + if (iter == roarings.end()) { + return false; + } + + // 1. The first bitmap must contain [start_low, uint32_max]. + if (!iter->second.containsRangeClosed(start_low, uint32_max)) { + return false; + } + + // 2. Every intermediate bitmap must contain [0, uint32_max] (full). + for (uint32_t high = start_high + 1; high != end_high; ++high) { + ++iter; + if (iter == roarings.end() || iter->first != high) { + return false; + } + if (!iter->second.containsRangeClosed(0, uint32_max)) { + return false; + } + } + + // 3. The last bitmap must contain [0, end_low]. + ++iter; + if (iter == roarings.end() || iter->first != end_high) { + return false; + } + return iter->second.containsRangeClosed(0, end_low); + } /** * Compute the intersection of the current bitmap and the provided bitmap, @@ -1947,10 +2050,9 @@ class Roaring64Map { } /** - * Convert the bitmap to an array. Write the output to "ans", - * caller is responsible to ensure that there is enough memory - * allocated - * (e.g., ans = new uint32[mybitmap.cardinality()];) + * Convert the bitmap to a sorted array. Write the output to "ans", the + * caller is responsible to ensure that there is enough memory allocated + * (e.g., ans = new uint64_t[mybitmap.cardinality()];) */ void toUint64Array(uint64_t *ans) const { // Annoyingly, VS 2017 marks std::accumulate() as [[nodiscard]] @@ -2256,13 +2358,15 @@ class Roaring64Map { const char *orig = buf; // push map size uint64_t map_size = roarings.size(); - std::memcpy(buf, &map_size, sizeof(uint64_t)); + uint64_t map_size_le = croaring_htole64(map_size); + std::memcpy(buf, &map_size_le, sizeof(uint64_t)); buf += sizeof(uint64_t); std::for_each(roarings.cbegin(), roarings.cend(), [&buf, portable]( const std::pair &map_entry) { // push map key - std::memcpy(buf, &map_entry.first, sizeof(uint32_t)); + uint32_t key_le = croaring_htole32(map_entry.first); + std::memcpy(buf, &key_le, sizeof(uint32_t)); // ^-- Note: `*((uint32_t*)buf) = map_entry.first;` is // undefined @@ -2290,11 +2394,13 @@ class Roaring64Map { // get map size uint64_t map_size; std::memcpy(&map_size, buf, sizeof(uint64_t)); + map_size = croaring_letoh64(map_size); buf += sizeof(uint64_t); for (uint64_t lcv = 0; lcv < map_size; lcv++) { // get map key uint32_t key; std::memcpy(&key, buf, sizeof(uint32_t)); + key = croaring_letoh32(key); // ^-- Note: `uint32_t key = *((uint32_t*)buf);` is undefined buf += sizeof(uint32_t); @@ -2324,6 +2430,7 @@ class Roaring64Map { } uint64_t map_size; std::memcpy(&map_size, buf, sizeof(uint64_t)); + map_size = croaring_letoh64(map_size); buf += sizeof(uint64_t); maxbytes -= sizeof(uint64_t); for (uint64_t lcv = 0; lcv < map_size; lcv++) { @@ -2332,6 +2439,7 @@ class Roaring64Map { } uint32_t key; std::memcpy(&key, buf, sizeof(uint32_t)); + key = croaring_letoh32(key); // ^-- Note: `uint32_t key = *((uint32_t*)buf);` is undefined buf += sizeof(uint32_t); diff --git a/croaring-sys/Cargo.toml b/croaring-sys/Cargo.toml index 32ad313..2816589 100644 --- a/croaring-sys/Cargo.toml +++ b/croaring-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "croaring-sys" -version = "4.7.0" +version = "4.7.1" edition = "2021" authors = ["croaring-rs developers"] license = "Apache-2.0" diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 4dd4ccc..46d3363 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -19,9 +19,9 @@ dependencies = [ [[package]] name = "bitvec" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837" dependencies = [ "funty", "radium", @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.39" +version = "1.2.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1354349954c6fc9cb0deab020f27f783cf0b604e8bb754dc4658ecf0d29c35f" +checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96" dependencies = [ "find-msvc-tools", "jobserver", @@ -43,13 +43,13 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "croaring" -version = "2.6.0" +version = "2.7.0" dependencies = [ "allocator-api2", "croaring-sys", @@ -66,7 +66,7 @@ dependencies = [ [[package]] name = "croaring-sys" -version = "4.7.0" +version = "4.7.1" dependencies = [ "cc", ] @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.2" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "funty" @@ -96,14 +96,14 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", "r-efi", - "wasi", + "wasip2", ] [[package]] @@ -118,15 +118,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.176" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libfuzzer-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" dependencies = [ "arbitrary", "cc", @@ -134,18 +134,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.41" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] @@ -164,15 +164,15 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "syn" -version = "2.0.106" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -187,33 +187,24 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "unicode-ident" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" - -[[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" -dependencies = [ - "wasip2", -] +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "wyz"