Skip to content

Commit 2e39654

Browse files
authored
Merge pull request #20 from RoaringBitmap/dlemire/updating_croaring
Syncing CRoaring.
2 parents 3b05334 + 0509d16 commit 2e39654

File tree

2 files changed

+333
-299
lines changed

2 files changed

+333
-299
lines changed

Sources/CRoaring/include/roaring.h

Lines changed: 56 additions & 6 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 2022-11-11T14:36:13Z
2+
// Created by amalgamation.sh on 2023-02-09T21:36:47Z
33

44
/*
55
* The CRoaring project is under a dual license (Apache/MIT).
@@ -58,11 +58,11 @@
5858
// /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand
5959
#ifndef ROARING_INCLUDE_ROARING_VERSION
6060
#define ROARING_INCLUDE_ROARING_VERSION
61-
#define ROARING_VERSION "0.7.3"
61+
#define ROARING_VERSION "0.9.5"
6262
enum {
6363
ROARING_VERSION_MAJOR = 0,
64-
ROARING_VERSION_MINOR = 7,
65-
ROARING_VERSION_REVISION = 3
64+
ROARING_VERSION_MINOR = 9,
65+
ROARING_VERSION_REVISION = 5
6666
};
6767
#endif // ROARING_INCLUDE_ROARING_VERSION
6868
/* end file include/roaring/roaring_version.h */
@@ -294,6 +294,11 @@ void roaring_bitmap_printf(const roaring_bitmap_t *r);
294294
/**
295295
* Computes the intersection between two bitmaps and returns new bitmap. The
296296
* caller is responsible for memory management.
297+
*
298+
* Performance hint: if you are computing the intersection between several
299+
* bitmaps, two-by-two, it is best to start with the smallest bitmap.
300+
* You may also rely on roaring_bitmap_and_inplace to avoid creating
301+
* many temporary bitmaps.
297302
*/
298303
roaring_bitmap_t *roaring_bitmap_and(const roaring_bitmap_t *r1,
299304
const roaring_bitmap_t *r2);
@@ -345,7 +350,10 @@ uint64_t roaring_bitmap_xor_cardinality(const roaring_bitmap_t *r1,
345350

346351
/**
347352
* Inplace version of `roaring_bitmap_and()`, modifies r1
348-
* r1 == r2 is allowed
353+
* r1 == r2 is allowed.
354+
*
355+
* Performance hint: if you are computing the intersection between several
356+
* bitmaps, two-by-two, it is best to start with the smallest bitmap.
349357
*/
350358
void roaring_bitmap_and_inplace(roaring_bitmap_t *r1,
351359
const roaring_bitmap_t *r2);
@@ -643,14 +651,20 @@ size_t roaring_bitmap_shrink_to_fit(roaring_bitmap_t *r);
643651
* more space efficient than the portable form, e.g. when the data is sparse.
644652
*
645653
* Returns how many bytes written, should be `roaring_bitmap_size_in_bytes(r)`.
654+
*
655+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
656+
* the data format is going to be big-endian and not compatible with little-endian systems.
646657
*/
647658
size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf);
648659

649660
/**
650661
* Use with `roaring_bitmap_serialize()`.
651662
*
652663
* (See `roaring_bitmap_portable_deserialize()` if you want a format that's
653-
* compatible with Java and Go implementations)
664+
* compatible with Java and Go implementations).
665+
*
666+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
667+
* the data format is going to be big-endian and not compatible with little-endian systems.
654668
*/
655669
roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf);
656670

@@ -670,6 +684,9 @@ size_t roaring_bitmap_size_in_bytes(const roaring_bitmap_t *r);
670684
*
671685
* This is meant to be compatible with the Java and Go versions:
672686
* https://github.com/RoaringBitmap/RoaringFormatSpec
687+
*
688+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
689+
* the data format is going to be big-endian and not compatible with little-endian systems.
673690
*/
674691
roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
675692

@@ -679,10 +696,34 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
679696
*
680697
* This is meant to be compatible with the Java and Go versions:
681698
* https://github.com/RoaringBitmap/RoaringFormatSpec
699+
*
700+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
701+
* the data format is going to be big-endian and not compatible with little-endian systems.
682702
*/
683703
roaring_bitmap_t *roaring_bitmap_portable_deserialize_safe(const char *buf,
684704
size_t maxbytes);
685705

706+
/**
707+
* Read bitmap from a serialized buffer.
708+
* In case of failure, NULL is returned.
709+
*
710+
* Bitmap returned by this function can be used in all readonly contexts.
711+
* Bitmap must be freed as usual, by calling roaring_bitmap_free().
712+
* Underlying buffer must not be freed or modified while it backs any bitmaps.
713+
*
714+
* The function is unsafe in the following ways:
715+
* 1) It may execute unaligned memory accesses.
716+
* 2) A buffer overflow may occur if buf does not point to a valid serialized
717+
* bitmap.
718+
*
719+
* This is meant to be compatible with the Java and Go versions:
720+
* https://github.com/RoaringBitmap/RoaringFormatSpec
721+
*
722+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
723+
* the data format is going to be big-endian and not compatible with little-endian systems.
724+
*/
725+
roaring_bitmap_t *roaring_bitmap_portable_deserialize_frozen(const char *buf);
726+
686727
/**
687728
* Check how many bytes would be read (up to maxbytes) at this pointer if there
688729
* is a bitmap, returns zero if there is no valid bitmap.
@@ -710,6 +751,9 @@ size_t roaring_bitmap_portable_size_in_bytes(const roaring_bitmap_t *r);
710751
*
711752
* This is meant to be compatible with the Java and Go versions:
712753
* https://github.com/RoaringBitmap/RoaringFormatSpec
754+
*
755+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
756+
* the data format is going to be big-endian and not compatible with little-endian systems.
713757
*/
714758
size_t roaring_bitmap_portable_serialize(const roaring_bitmap_t *r, char *buf);
715759

@@ -740,6 +784,9 @@ size_t roaring_bitmap_frozen_size_in_bytes(const roaring_bitmap_t *r);
740784
/**
741785
* Serializes bitmap using frozen format.
742786
* Buffer size must be at least roaring_bitmap_frozen_size_in_bytes().
787+
*
788+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
789+
* the data format is going to be big-endian and not compatible with little-endian systems.
743790
*/
744791
void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *r, char *buf);
745792

@@ -753,6 +800,9 @@ void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *r, char *buf);
753800
* Bitmap returned by this function can be used in all readonly contexts.
754801
* Bitmap must be freed as usual, by calling roaring_bitmap_free().
755802
* Underlying buffer must not be freed or modified while it backs any bitmaps.
803+
*
804+
* This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x),
805+
* the data format is going to be big-endian and not compatible with little-endian systems.
756806
*/
757807
const roaring_bitmap_t *roaring_bitmap_frozen_view(const char *buf,
758808
size_t length);

0 commit comments

Comments
 (0)