Skip to content

Commit

Permalink
Merge pull request #20 from RoaringBitmap/dlemire/updating_croaring
Browse files Browse the repository at this point in the history
Syncing CRoaring.
  • Loading branch information
lemire authored Feb 9, 2023
2 parents 3b05334 + 0509d16 commit 2e39654
Show file tree
Hide file tree
Showing 2 changed files with 333 additions and 299 deletions.
62 changes: 56 additions & 6 deletions Sources/CRoaring/include/roaring.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
// Created by amalgamation.sh on 2022-11-11T14:36:13Z
// Created by amalgamation.sh on 2023-02-09T21:36:47Z

/*
* The CRoaring project is under a dual license (Apache/MIT).
Expand Down Expand Up @@ -58,11 +58,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 "0.7.3"
#define ROARING_VERSION "0.9.5"
enum {
ROARING_VERSION_MAJOR = 0,
ROARING_VERSION_MINOR = 7,
ROARING_VERSION_REVISION = 3
ROARING_VERSION_MINOR = 9,
ROARING_VERSION_REVISION = 5
};
#endif // ROARING_INCLUDE_ROARING_VERSION
/* end file include/roaring/roaring_version.h */
Expand Down Expand Up @@ -294,6 +294,11 @@ void roaring_bitmap_printf(const roaring_bitmap_t *r);
/**
* Computes the intersection between two bitmaps and returns new bitmap. The
* caller is responsible for memory management.
*
* Performance hint: if you are computing the intersection between several
* bitmaps, two-by-two, it is best to start with the smallest bitmap.
* You may also rely on roaring_bitmap_and_inplace to avoid creating
* many temporary bitmaps.
*/
roaring_bitmap_t *roaring_bitmap_and(const roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
Expand Down Expand Up @@ -345,7 +350,10 @@ uint64_t roaring_bitmap_xor_cardinality(const roaring_bitmap_t *r1,

/**
* Inplace version of `roaring_bitmap_and()`, modifies r1
* r1 == r2 is allowed
* r1 == r2 is allowed.
*
* Performance hint: if you are computing the intersection between several
* bitmaps, two-by-two, it is best to start with the smallest bitmap.
*/
void roaring_bitmap_and_inplace(roaring_bitmap_t *r1,
const roaring_bitmap_t *r2);
Expand Down Expand Up @@ -643,14 +651,20 @@ size_t roaring_bitmap_shrink_to_fit(roaring_bitmap_t *r);
* more space efficient than the portable form, e.g. when the data is sparse.
*
* 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.
*/
size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf);

/**
* Use with `roaring_bitmap_serialize()`.
*
* (See `roaring_bitmap_portable_deserialize()` if you want a format that's
* compatible with Java and Go implementations)
* 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.
*/
roaring_bitmap_t *roaring_bitmap_deserialize(const void *buf);

Expand All @@ -670,6 +684,9 @@ 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.
*/
roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);

Expand All @@ -679,10 +696,34 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
*
* 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.
*/
roaring_bitmap_t *roaring_bitmap_portable_deserialize_safe(const char *buf,
size_t maxbytes);

/**
* Read bitmap from a serialized buffer.
* In case of failure, NULL is returned.
*
* Bitmap returned by this function can be used in all readonly contexts.
* Bitmap must be freed as usual, by calling roaring_bitmap_free().
* Underlying buffer must not be freed or modified while it backs any bitmaps.
*
* The function is unsafe in the following ways:
* 1) It may execute unaligned memory accesses.
* 2) A buffer overflow may occur if buf does not point to a valid serialized
* bitmap.
*
* 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.
*/
roaring_bitmap_t *roaring_bitmap_portable_deserialize_frozen(const char *buf);

/**
* Check how many bytes would be read (up to maxbytes) at this pointer if there
* is a bitmap, returns zero if there is no valid bitmap.
Expand Down Expand Up @@ -710,6 +751,9 @@ 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.
*/
size_t roaring_bitmap_portable_serialize(const roaring_bitmap_t *r, char *buf);

Expand Down Expand Up @@ -740,6 +784,9 @@ size_t roaring_bitmap_frozen_size_in_bytes(const roaring_bitmap_t *r);
/**
* Serializes bitmap using frozen format.
* Buffer size must be at least roaring_bitmap_frozen_size_in_bytes().
*
* 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.
*/
void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *r, char *buf);

Expand All @@ -753,6 +800,9 @@ void roaring_bitmap_frozen_serialize(const roaring_bitmap_t *r, char *buf);
* Bitmap returned by this function can be used in all readonly contexts.
* Bitmap must be freed as usual, by calling roaring_bitmap_free().
* Underlying buffer must not be freed or modified while it backs any bitmaps.
*
* 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.
*/
const roaring_bitmap_t *roaring_bitmap_frozen_view(const char *buf,
size_t length);
Expand Down
Loading

0 comments on commit 2e39654

Please sign in to comment.