Changeset: 8db7ae52c4b5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8db7ae52c4b5
Modified Files:
gdk/gdk_align.c
gdk/gdk_batop.c
Branch: Jul2021
Log Message:
When unsharing a vheap, also unfix the (former) parent.
diffs (46 lines):
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -140,6 +140,7 @@ VIEWcreate(oid seq, BAT *b)
}
if (bn->tvheap) {
BBPunshare(bn->tvheap->parentid);
+ BBPunfix(bn->tvheap->parentid);
HEAPdecref(bn->tvheap, false);
}
HEAPdecref(bn->theap, false);
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -91,8 +91,10 @@ insert_string_bat(BAT *b, BAT *n, struct
/* we can share the vheaps, so we then only need to
* append the offsets */
MT_lock_set(&b->theaplock);
- if (b->tvheap->parentid != b->batCacheid)
+ if (b->tvheap->parentid != b->batCacheid) {
BBPunshare(b->tvheap->parentid);
+ BBPunfix(b->tvheap->parentid);
+ }
HEAPdecref(b->tvheap, b->tvheap->parentid == b->batCacheid);
HEAPincref(ni.vh);
b->tvheap = ni.vh;
@@ -381,8 +383,10 @@ append_varsized_bat(BAT *b, BAT *n, stru
/* make sure locking happens in a predictable order:
* lowest id first */
MT_lock_set(&b->theaplock);
- if (b->tvheap->parentid != b->batCacheid)
+ if (b->tvheap->parentid != b->batCacheid) {
BBPunshare(b->tvheap->parentid);
+ BBPunfix(b->tvheap->parentid);
+ }
BBPshare(ni.vh->parentid);
HEAPdecref(b->tvheap, true);
HEAPincref(ni.vh);
@@ -441,6 +445,7 @@ append_varsized_bat(BAT *b, BAT *n, stru
return GDK_FAIL;
}
BBPunshare(b->tvheap->parentid);
+ BBPunfix(b->tvheap->parentid);
MT_lock_set(&b->theaplock);
HEAPdecref(b->tvheap, false);
ATOMIC_INIT(&h->refs, 1);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]