|
1 | 1 | // !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!!
|
2 |
| -// Created by amalgamation.sh on Wed 8 Jun 2022 15:13:10 EDT |
| 2 | +// Created by amalgamation.sh on 2022-11-11T14:36:13Z |
3 | 3 |
|
4 | 4 | /*
|
5 |
| - * Copyright 2016-2020 The CRoaring authors |
| 5 | + * The CRoaring project is under a dual license (Apache/MIT). |
| 6 | + * Users of the library may choose one or the other license. |
| 7 | + */ |
| 8 | +/* |
| 9 | + * Copyright 2016-2022 The CRoaring authors |
6 | 10 | *
|
7 | 11 | * Licensed under the Apache License, Version 2.0 (the "License");
|
8 | 12 | * you may not use this file except in compliance with the License.
|
|
18 | 22 | *
|
19 | 23 | * SPDX-License-Identifier: Apache-2.0
|
20 | 24 | */
|
| 25 | +/* |
| 26 | + * MIT License |
| 27 | + * |
| 28 | + * Copyright 2016-2022 The CRoaring authors |
| 29 | + * |
| 30 | + * Permission is hereby granted, free of charge, to any |
| 31 | + * person obtaining a copy of this software and associated |
| 32 | + * documentation files (the "Software"), to deal in the |
| 33 | + * Software without restriction, including without |
| 34 | + * limitation the rights to use, copy, modify, merge, |
| 35 | + * publish, distribute, sublicense, and/or sell copies of |
| 36 | + * the Software, and to permit persons to whom the Software |
| 37 | + * is furnished to do so, subject to the following |
| 38 | + * conditions: |
| 39 | + * |
| 40 | + * The above copyright notice and this permission notice |
| 41 | + * shall be included in all copies or substantial portions |
| 42 | + * of the Software. |
| 43 | + * |
| 44 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF |
| 45 | + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
| 46 | + * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 47 | + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT |
| 48 | + * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 49 | + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 50 | + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR |
| 51 | + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 52 | + * DEALINGS IN THE SOFTWARE. |
| 53 | + * |
| 54 | + * SPDX-License-Identifier: MIT |
| 55 | + */ |
21 | 56 |
|
22 | 57 | /* begin file include/roaring/roaring_version.h */
|
23 | 58 | // /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand
|
24 | 59 | #ifndef ROARING_INCLUDE_ROARING_VERSION
|
25 | 60 | #define ROARING_INCLUDE_ROARING_VERSION
|
26 |
| -#define ROARING_VERSION "0.5.0" |
| 61 | +#define ROARING_VERSION "0.7.3" |
27 | 62 | enum {
|
28 | 63 | ROARING_VERSION_MAJOR = 0,
|
29 |
| - ROARING_VERSION_MINOR = 5, |
30 |
| - ROARING_VERSION_REVISION = 0 |
| 64 | + ROARING_VERSION_MINOR = 7, |
| 65 | + ROARING_VERSION_REVISION = 3 |
31 | 66 | };
|
32 | 67 | #endif // ROARING_INCLUDE_ROARING_VERSION
|
33 | 68 | /* end file include/roaring/roaring_version.h */
|
@@ -394,9 +429,48 @@ void roaring_bitmap_andnot_inplace(roaring_bitmap_t *r1,
|
394 | 429 | */
|
395 | 430 | void roaring_bitmap_free(const roaring_bitmap_t *r);
|
396 | 431 |
|
| 432 | +/** |
| 433 | + * A bit of context usable with `roaring_bitmap_*_bulk()` functions |
| 434 | + * |
| 435 | + * Should be initialized with `{0}` (or `memset()` to all zeros). |
| 436 | + * Callers should treat it as an opaque type. |
| 437 | + * |
| 438 | + * A context may only be used with a single bitmap |
| 439 | + * (unless re-initialized to zero), and any modification to a bitmap |
| 440 | + * (other than modifications performed with `_bulk()` functions with the context |
| 441 | + * passed) will invalidate any contexts associated with that bitmap. |
| 442 | + */ |
| 443 | +typedef struct roaring_bulk_context_s { |
| 444 | + ROARING_CONTAINER_T *container; |
| 445 | + int idx; |
| 446 | + uint16_t key; |
| 447 | + uint8_t typecode; |
| 448 | +} roaring_bulk_context_t; |
| 449 | + |
| 450 | +/** |
| 451 | + * Add an item, using context from a previous insert for speed optimization. |
| 452 | + * |
| 453 | + * `context` will be used to store information between calls to make bulk |
| 454 | + * operations faster. `*context` should be zero-initialized before the first |
| 455 | + * call to this function. |
| 456 | + * |
| 457 | + * Modifying the bitmap in any way (other than `-bulk` suffixed functions) |
| 458 | + * will invalidate the stored context, calling this function with a non-zero |
| 459 | + * context after doing any modification invokes undefined behavior. |
| 460 | + * |
| 461 | + * In order to exploit this optimization, the caller should call this function |
| 462 | + * with values with the same "key" (high 16 bits of the value) consecutively. |
| 463 | + */ |
| 464 | +void roaring_bitmap_add_bulk(roaring_bitmap_t *r, |
| 465 | + roaring_bulk_context_t *context, uint32_t val); |
| 466 | + |
397 | 467 | /**
|
398 | 468 | * Add value n_args from pointer vals, faster than repeatedly calling
|
399 | 469 | * `roaring_bitmap_add()`
|
| 470 | + * |
| 471 | + * In order to exploit this optimization, the caller should attempt to keep |
| 472 | + * values with the same "key" (high 16 bits of the value) as consecutive |
| 473 | + * elements in `vals` |
400 | 474 | */
|
401 | 475 | void roaring_bitmap_add_many(roaring_bitmap_t *r, size_t n_args,
|
402 | 476 | const uint32_t *vals);
|
@@ -472,6 +546,25 @@ bool roaring_bitmap_contains_range(const roaring_bitmap_t *r,
|
472 | 546 | uint64_t range_start,
|
473 | 547 | uint64_t range_end);
|
474 | 548 |
|
| 549 | +/** |
| 550 | + * Check if an items is present, using context from a previous insert for speed |
| 551 | + * optimization. |
| 552 | + * |
| 553 | + * `context` will be used to store information between calls to make bulk |
| 554 | + * operations faster. `*context` should be zero-initialized before the first |
| 555 | + * call to this function. |
| 556 | + * |
| 557 | + * Modifying the bitmap in any way (other than `-bulk` suffixed functions) |
| 558 | + * will invalidate the stored context, calling this function with a non-zero |
| 559 | + * context after doing any modification invokes undefined behavior. |
| 560 | + * |
| 561 | + * In order to exploit this optimization, the caller should call this function |
| 562 | + * with values with the same "key" (high 16 bits of the value) consecutively. |
| 563 | + */ |
| 564 | +bool roaring_bitmap_contains_bulk(const roaring_bitmap_t *r, |
| 565 | + roaring_bulk_context_t *context, |
| 566 | + uint32_t val); |
| 567 | + |
475 | 568 | /**
|
476 | 569 | * Get the cardinality of the bitmap (number of elements).
|
477 | 570 | */
|
@@ -951,7 +1044,6 @@ uint32_t roaring_read_uint32_iterator(roaring_uint32_iterator_t *it,
|
951 | 1044 | using namespace ::roaring::api;
|
952 | 1045 | #endif
|
953 | 1046 | #endif
|
954 |
| - |
955 | 1047 | /* end file include/roaring/roaring.h */
|
956 | 1048 | /* begin file include/roaring/memory.h */
|
957 | 1049 | #ifndef INCLUDE_ROARING_MEMORY_H_
|
|
0 commit comments