Skip to content

Commit 00bcc00

Browse files
committed
Newer version.
1 parent c1d1a75 commit 00bcc00

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

roaring.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Fri Aug 30 19:43:10 EDT 2019. Do not edit! */
1+
/* auto-generated on Mon 17 Feb 2020 14:42:17 EST. Do not edit! */
22
#include "roaring.h"
33

44
/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */
@@ -643,8 +643,8 @@ int32_t difference_vector16(const uint16_t *__restrict__ A, size_t s_a,
643643
}
644644
if (i_a < s_a) {
645645
if(C == A) {
646-
assert(count <= i_a);
647-
if(count < i_a) {
646+
assert((size_t)count <= i_a);
647+
if((size_t)count < i_a) {
648648
memmove(C + count, A + i_a, sizeof(uint16_t) * (s_a - i_a));
649649
}
650650
} else {
@@ -4462,7 +4462,8 @@ run_container_t *run_container_from_array(const array_container_t *c) {
44624462
/**
44634463
* Convert the runcontainer to either a Bitmap or an Array Container, depending
44644464
* on the cardinality. Frees the container.
4465-
* Allocates and returns new container, which caller is responsible for freeing
4465+
* Allocates and returns new container, which caller is responsible for freeing.
4466+
* It does not free the run container.
44664467
*/
44674468

44684469
void *convert_to_bitset_or_array_container(run_container_t *r, int32_t card,
@@ -4480,7 +4481,7 @@ void *convert_to_bitset_or_array_container(run_container_t *r, int32_t card,
44804481
}
44814482
assert(card == answer->cardinality);
44824483
*resulttype = ARRAY_CONTAINER_TYPE_CODE;
4483-
run_container_free(r);
4484+
//run_container_free(r);
44844485
return answer;
44854486
}
44864487
bitset_container_t *answer = bitset_container_create();
@@ -4490,7 +4491,7 @@ void *convert_to_bitset_or_array_container(run_container_t *r, int32_t card,
44904491
}
44914492
answer->cardinality = card;
44924493
*resulttype = BITSET_CONTAINER_TYPE_CODE;
4493-
run_container_free(r);
4494+
//run_container_free(r);
44944495
return answer;
44954496
}
44964497

@@ -8837,14 +8838,15 @@ bool roaring_bitmap_remove_run_compression(roaring_bitmap_t *r) {
88378838
int32_t card = run_container_cardinality(truec);
88388839
void *c1 = convert_to_bitset_or_array_container(
88398840
truec, card, &typecode_after);
8840-
shared_container_free((shared_container_t *)c);
8841+
shared_container_free((shared_container_t *)c);// will free the run container as needed
88418842
ra_set_container_at_index(&r->high_low_container, i, c1,
88428843
typecode_after);
88438844

88448845
} else {
88458846
int32_t card = run_container_cardinality((run_container_t *)c);
88468847
void *c1 = convert_to_bitset_or_array_container(
88478848
(run_container_t *)c, card, &typecode_after);
8849+
run_container_free((run_container_t *)c);
88488850
ra_set_container_at_index(&r->high_low_container, i, c1,
88498851
typecode_after);
88508852
}
@@ -10468,6 +10470,7 @@ roaring_bitmap_frozen_view(const char *buf, size_t length) {
1046810470
break;
1046910471
}
1047010472
default:
10473+
free(arena);
1047110474
return NULL;
1047210475
}
1047310476
}

roaring.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
/* auto-generated on Fri Aug 30 19:43:10 EDT 2019. Do not edit! */
1+
/* auto-generated on Mon 17 Feb 2020 14:42:17 EST. Do not edit! */
22
/* begin file include/roaring/roaring_version.h */
33
// /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand
44
#ifndef ROARING_INCLUDE_ROARING_VERSION
55
#define ROARING_INCLUDE_ROARING_VERSION
6-
#define ROARING_VERSION = 0.2.65,
6+
#define ROARING_VERSION = 0.2.66,
77
enum {
88
ROARING_VERSION_MAJOR = 0,
99
ROARING_VERSION_MINOR = 2,
10-
ROARING_VERSION_REVISION = 65
10+
ROARING_VERSION_REVISION = 66
1111
};
1212
#endif // ROARING_INCLUDE_ROARING_VERSION
1313
/* end file include/roaring/roaring_version.h */
@@ -2880,7 +2880,7 @@ array_container_t *array_container_from_bitset(const bitset_container_t *bits);
28802880
run_container_t *run_container_from_array(const array_container_t *c);
28812881

28822882
/* convert a run into either an array or a bitset
2883-
* might free the container */
2883+
* might free the container. This does not free the input run container. */
28842884
void *convert_to_bitset_or_array_container(run_container_t *r, int32_t card,
28852885
uint8_t *resulttype);
28862886

roaring.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Fri Aug 30 19:43:10 EDT 2019. Do not edit! */
1+
/* auto-generated on Mon 17 Feb 2020 14:42:17 EST. Do not edit! */
22
#include "roaring.h"
33
/* begin file cpp/roaring.hh */
44
/*
@@ -1179,7 +1179,7 @@ class Roaring64Map {
11791179
*/
11801180
bool removeRunCompression() {
11811181
return std::accumulate(
1182-
roarings.begin(), roarings.end(), false,
1182+
roarings.begin(), roarings.end(), true,
11831183
[](bool previous, std::pair<const uint32_t, Roaring> &map_entry) {
11841184
return map_entry.second.removeRunCompression() && previous;
11851185
});
@@ -1193,7 +1193,7 @@ class Roaring64Map {
11931193
*/
11941194
bool runOptimize() {
11951195
return std::accumulate(
1196-
roarings.begin(), roarings.end(), false,
1196+
roarings.begin(), roarings.end(), true,
11971197
[](bool previous, std::pair<const uint32_t, Roaring> &map_entry) {
11981198
return map_entry.second.runOptimize() && previous;
11991199
});

0 commit comments

Comments
 (0)