Skip to content

Commit

Permalink
documentation of roaring_bitmap_frozen_view says buffer has to be ali…
Browse files Browse the repository at this point in the history
…gned by 32 bytes.
  • Loading branch information
smmathews-brandwatch committed Oct 11, 2023
1 parent 93cf8a8 commit c85242f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions roaringbitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ roaringbitmap_in(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r1);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r1, VARDATA(serializedbytes));
roaring_bitmap_free(r1);

Expand Down Expand Up @@ -373,7 +373,7 @@ rb_or(PG_FUNCTION_ARGS) {
roaring_bitmap_free(r1);
roaring_bitmap_free(r2);
expectedsize = roaring_bitmap_frozen_size_in_bytes(r3);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r3, VARDATA(serializedbytes));
roaring_bitmap_free(r3);

Expand Down Expand Up @@ -457,7 +457,7 @@ rb_and(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r, VARDATA(serializedbytes));
roaring_bitmap_free(r);

Expand Down Expand Up @@ -542,7 +542,7 @@ rb_andnot(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r, VARDATA(serializedbytes));
roaring_bitmap_free(r);

Expand Down Expand Up @@ -619,7 +619,7 @@ rb_xor(PG_FUNCTION_ARGS) {
roaring_bitmap_free(r1);
roaring_bitmap_free(r2);
expectedsize = roaring_bitmap_frozen_size_in_bytes(r3);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r3, VARDATA(serializedbytes));
roaring_bitmap_free(r3);

Expand Down Expand Up @@ -969,7 +969,7 @@ rb_add(PG_FUNCTION_ARGS) {
roaring_bitmap_add(r2, value);

expectedsize = roaring_bitmap_frozen_size_in_bytes(r2);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r2, VARDATA(serializedbytes));
roaring_bitmap_free(r2);

Expand Down Expand Up @@ -1001,7 +1001,7 @@ rb_remove(PG_FUNCTION_ARGS) {
roaring_bitmap_remove(r2, value);

expectedsize = roaring_bitmap_frozen_size_in_bytes(r2);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r2, VARDATA(serializedbytes));
roaring_bitmap_free(r2);

Expand Down Expand Up @@ -1171,7 +1171,7 @@ rb_fill(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r3);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r3, VARDATA(serializedbytes));
roaring_bitmap_free(r3);

Expand Down Expand Up @@ -1225,7 +1225,7 @@ rb_clear(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r3);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r3, VARDATA(serializedbytes));
roaring_bitmap_free(r3);

Expand Down Expand Up @@ -1269,7 +1269,7 @@ rb_flip(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r2);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r2, VARDATA(serializedbytes));
roaring_bitmap_free(r2);

Expand Down Expand Up @@ -1332,7 +1332,7 @@ rb_shiftright(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r1);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r1, VARDATA(serializedbytes));
roaring_bitmap_free(r1);

Expand Down Expand Up @@ -1387,7 +1387,7 @@ rb_range(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r2);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r2, VARDATA(serializedbytes));
roaring_bitmap_free(r1);
roaring_bitmap_free(r2);
Expand Down Expand Up @@ -1524,7 +1524,7 @@ rb_select(PG_FUNCTION_ARGS) {
}

expectedsize = roaring_bitmap_frozen_size_in_bytes(r2);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r2, VARDATA(serializedbytes));
roaring_bitmap_free(r1);
roaring_bitmap_free(r2);
Expand Down Expand Up @@ -1559,7 +1559,7 @@ rb_build(PG_FUNCTION_ARGS) {

expectedsize = roaring_bitmap_frozen_size_in_bytes(r1);

serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r1, VARDATA(serializedbytes));
roaring_bitmap_free(r1);

Expand Down Expand Up @@ -1993,7 +1993,7 @@ rb_serialize(PG_FUNCTION_ARGS) {
r1 = (roaring_bitmap_t *) PG_GETARG_POINTER(0);

expectedsize = roaring_bitmap_frozen_size_in_bytes(r1);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r1, VARDATA(serializedbytes));

SET_VARSIZE(serializedbytes, VARHDRSZ + expectedsize);
Expand Down Expand Up @@ -2084,7 +2084,7 @@ rb_runoptimize(PG_FUNCTION_ARGS) {
roaring_bitmap_run_optimize(r2);

expectedsize = roaring_bitmap_frozen_size_in_bytes(r2);
serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize);
serializedbytes = (bytea *) pg_aligned_malloc(32, VARHDRSZ + expectedsize);
roaring_bitmap_frozen_serialize(r2, VARDATA(serializedbytes));

roaring_bitmap_free(r2);
Expand Down

0 comments on commit c85242f

Please sign in to comment.