Changeset: 72866b54044d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/72866b54044d
Modified Files:
gdk/gdk.h
gdk/gdk_batop.c
gdk/gdk_project.c
monetdb5/modules/mal/remote.c
sql/backends/monet5/sql_result.c
Branch: Jul2021
Log Message:
Use vhfree field from bat iterator.
diffs (114 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1896,7 +1896,7 @@ Tpos(BATiter *bi, BUN p)
oid o;
assert(!is_oid_nil(bi->tseq));
if (((ccand_t *) bi->vh)->type == CAND_NEGOID) {
- BUN nexc = (bi->vh->free - sizeof(ccand_t)) /
SIZEOF_OID;
+ BUN nexc = (bi->vhfree - sizeof(ccand_t)) / SIZEOF_OID;
o = bi->tseq + p;
if (nexc > 0) {
const oid *exc = (const oid *) (bi->vh->base +
sizeof(ccand_t));
@@ -1919,7 +1919,7 @@ Tpos(BATiter *bi, BUN p)
}
} else {
const uint32_t *msk = (const uint32_t *) (bi->vh->base
+ sizeof(ccand_t));
- BUN nmsk = (bi->vh->free - sizeof(ccand_t)) /
sizeof(uint32_t);
+ BUN nmsk = (bi->vhfree - sizeof(ccand_t)) /
sizeof(uint32_t);
o = 0;
for (BUN i = 0; i < nmsk; i++) {
uint32_t m = candmask_pop(msk[i]);
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -135,7 +135,7 @@ insert_string_bat(BAT *b, BAT *n, struct
len = GDK_STRHASHSIZE + ci->ncand * (len + 12);
/* len is total estimated expected size of vheap */
- if (len > ni.vh->free / 2) {
+ if (len > ni.vhfree / 2) {
/* we copy the string heap, perhaps appending */
if (oldcnt == 0) {
toff = 0;
@@ -149,8 +149,8 @@ insert_string_bat(BAT *b, BAT *n, struct
bat_iterator_end(&ni);
return GDK_FAIL;
}
- memcpy(b->tvheap->base + toff, ni.vh->base,
ni.vh->free);
- b->tvheap->free = toff + ni.vh->free;
+ memcpy(b->tvheap->base + toff, ni.vh->base,
ni.vhfree);
+ b->tvheap->free = toff + ni.vhfree;
}
}
}
@@ -257,7 +257,7 @@ insert_string_bat(BAT *b, BAT *n, struct
break;
}
}
- } else if (b->tvheap->free < ni.vh->free / 2 ||
+ } else if (b->tvheap->free < ni.vhfree / 2 ||
GDK_ELIMDOUBLES(b->tvheap)) {
/* if b's string heap is much smaller than n's string
* heap, don't bother checking whether n's string
diff --git a/gdk/gdk_project.c b/gdk/gdk_project.c
--- a/gdk/gdk_project.c
+++ b/gdk/gdk_project.c
@@ -390,7 +390,7 @@ project_str(BAT *restrict l, struct cand
TRANSIENT)) == NULL)
return NULL;
- v = (var_t) r1i->vh->free;
+ v = (var_t) r1i->vhfree;
if (r1i->vh == r2i->vh) {
h1off = 0;
BBPshare(r1i->vh->parentid);
@@ -400,18 +400,18 @@ project_str(BAT *restrict l, struct cand
} else {
v = (v + GDK_VARALIGN - 1) & ~(GDK_VARALIGN - 1);
h1off = (BUN) v;
- v += ((var_t) r2i->vh->free + GDK_VARALIGN - 1) &
~(GDK_VARALIGN - 1);
+ v += ((var_t) r2i->vhfree + GDK_VARALIGN - 1) & ~(GDK_VARALIGN
- 1);
if (HEAPextend(bn->tvheap, v, false) != GDK_SUCCEED) {
BBPreclaim(bn);
return NULL;
}
- memcpy(bn->tvheap->base, r1i->vh->base, r1i->vh->free);
+ memcpy(bn->tvheap->base, r1i->vh->base, r1i->vhfree);
#ifndef NDEBUG
- if (h1off > r1i->vh->free)
- memset(bn->tvheap->base + r1i->vh->free, 0, h1off -
r1i->vh->free);
+ if (h1off > r1i->vhfree)
+ memset(bn->tvheap->base + r1i->vhfree, 0, h1off -
r1i->vhfree);
#endif
- memcpy(bn->tvheap->base + h1off, r2i->vh->base, r2i->vh->free);
- bn->tvheap->free = h1off + r2i->vh->free;
+ memcpy(bn->tvheap->base + h1off, r2i->vh->base, r2i->vhfree);
+ bn->tvheap->free = h1off + r2i->vhfree;
}
if (v >= ((var_t) 1 << (8 << bn->tshift)) &&
diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -1559,7 +1559,7 @@ static str RMTbincopyto(Client cntxt, Ma
vi.base, vi.count * vi.width, 1);
if (sendtheap)
mnstr_write(cntxt->fdout, /* theap */
- vi.vh->base, vi.vh->free, 1);
+ vi.vh->base, vi.vhfree, 1);
bat_iterator_end(&vi);
}
/* flush is done by the calling environment (MAL) */
diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -857,7 +857,7 @@ mvc_export_binary_bat(stream *s, BAT* bn
BATiter bni = bat_iterator(bn);
mnstr_write(s, /* tail */ bni.base, bni.count *
bni.width, 1);
if (sendtheap)
- mnstr_write(s, /* theap */ bni.vh->base,
bni.vh->free, 1);
+ mnstr_write(s, /* theap */ bni.vh->base,
bni.vhfree, 1);
bat_iterator_end(&bni);
}
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list