Changeset: e64cef7442d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e64cef7442d5
Modified Files:
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_cand.c
gdk/gdk_join.c
sql/backends/monet5/UDF/pyapi3/convert_loops.h
Branch: Jul2021
Log Message:
Set the heap dirty flag in more places.
diffs (124 lines):
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1243,6 +1243,7 @@ BUNappendmulti(BAT *b, const void *value
}
BATrmprop(b, GDK_UNIQUE_ESTIMATE);
+ b->theap->dirty |= count > 0;
for (BUN i = 0; i < count; i++) {
void *t = b->ttype && b->tvarsized ? ((void **) values)[i] :
(void *) ((char *) values + i * Tsize(b));
@@ -1255,8 +1256,6 @@ BUNappendmulti(BAT *b, const void *value
}
p++;
}
- if (b->theap)
- b->theap->dirty |= count > 0;
IMPSdestroy(b); /* no support for inserts in imprints yet */
OIDXdestroy(b);
@@ -1756,6 +1755,7 @@ BATsetcount(BAT *b, BUN cnt)
b->batCount = cnt;
b->batDirtydesc = true;
+ b->theap->dirty |= b->ttype != TYPE_void;
if (b->theap->parentid == b->batCacheid)
b->theap->free = tailsize(b, cnt);
if (b->ttype == TYPE_void)
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -540,6 +540,7 @@ append_msk_bat(BAT *b, BAT *n, struct ca
uint32_t boff = b->batCount % 32;
uint32_t *bp = (uint32_t *) b->theap->base + b->batCount / 32;
b->batCount += ci->ncand;
+ b->theap->dirty = true;
b->theap->free = ((b->batCount + 31) / 32) * 4;
if (ci->tpe == cand_dense) {
uint32_t *np;
diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c
--- a/gdk/gdk_cand.c
+++ b/gdk/gdk_cand.c
@@ -1318,6 +1318,7 @@ BATnegcands(BUN nr, BAT *odels)
};
dels->parentid = bn->batCacheid;
dels->free = sizeof(ccand_t) + sizeof(oid) * (hi - lo);
+ dels->dirty = true;
if (odels->ttype == TYPE_void) {
oid *r = (oid *) (dels->base + sizeof(ccand_t));
for (BUN x = lo; x < hi; x++)
@@ -1382,6 +1383,7 @@ BATmaskedcands(oid hseq, BUN nr, BAT *ma
};
msks->parentid = bn->batCacheid;
msks->free = sizeof(ccand_t) + nmask * sizeof(uint32_t);
+ msks->dirty = true;
uint32_t *r = (uint32_t*)(msks->base + sizeof(ccand_t));
if (selected) {
if (nr <= BATcount(masked))
@@ -1502,9 +1504,10 @@ BATunmask(BAT *b)
HEAPfree(dels, true);
GDKfree(dels);
} else {
+ dels->free = sizeof(ccand_t) + n * sizeof(oid);
+ dels->dirty = true;
ATOMIC_INIT(&dels->refs, 1);
bn->tvheap = dels;
- bn->tvheap->free = sizeof(ccand_t) + n * sizeof(oid);
}
BATsetcount(bn, n=BATcount(b));
bn->tseqbase = tseq;
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -185,6 +185,7 @@ joininitresults(BAT **r1p, BAT **r2p, BU
r1->tsorted = true;
r1->trevsorted = true;
r1->tseqbase = 0;
+ r1->theap->dirty = true;
*r1p = r1;
if (r2p) {
r2 = COLnew(0, TYPE_oid, size, TRANSIENT);
@@ -198,6 +199,7 @@ joininitresults(BAT **r1p, BAT **r2p, BU
r2->tsorted = true;
r2->trevsorted = true;
r2->tseqbase = 0;
+ r2->theap->dirty = true;
*r2p = r2;
}
return maxsize;
diff --git a/sql/backends/monet5/UDF/pyapi3/convert_loops.h
b/sql/backends/monet5/UDF/pyapi3/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi3/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi3/convert_loops.h
@@ -99,10 +99,11 @@
bat->theap->size = ret->count * ret->memory_size;
\
bat->theap->free =
\
bat->theap->size; /*There are no free places in the
array*/ \
- /*If index_offset > 0, we are mapping part of a
multidimensional \
- * array.*/
\
- /*The entire array will be cleared when the part with
index_offset=0 \
- * is freed*/
\
+ bat->theap->dirty = true;
\
+ /*If index_offset > 0, we are mapping part of a
multidimensional */ \
+ /* array.*/
\
+ /*The entire array will be cleared when the part with
index_offset=0 */\
+ /* is freed*/
\
/*So we set this part of the mapping to 'NOWN'*/
\
if (index_offset > 0)
\
bat->theap->storage = STORE_NOWN;
\
@@ -162,10 +163,11 @@
bat->theap->size = ret->count * ret->memory_size;
\
bat->theap->free =
\
bat->theap->size; /*There are no free places in the
array*/ \
- /*If index_offset > 0, we are mapping part of a
multidimensional \
- * array.*/
\
- /*The entire array will be cleared when the part with
index_offset=0 \
- * is freed*/
\
+ bat->theap->dirty = true;
\
+ /*If index_offset > 0, we are mapping part of a
multidimensional */ \
+ /* array.*/
\
+ /*The entire array will be cleared when the part with
index_offset=0 */\
+ /* is freed*/
\
/*So we set this part of the mapping to 'NOWN'*/
\
if (index_offset > 0)
\
bat->theap->storage = STORE_NOWN;
\
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list