Changeset: 9dd7ea5944d3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9dd7ea5944d3
Modified Files:
        gdk/gdk_bat.c
        gdk/gdk_bbp.c
Branch: Sep2022
Log Message:

Delete old tail file when destroying a bat.


diffs (29 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -732,9 +732,9 @@ BATdestroy(BAT *b)
                GDKfree(b->theap);
        }
        if (b->oldtail) {
+               ATOMIC_AND(&b->oldtail->refs, ~DELAYEDREMOVE);
                /* the bat has not been committed, so we cannot remove
                 * the old tail file */
-               ATOMIC_AND(&b->oldtail->refs, ~DELAYEDREMOVE);
                HEAPdecref(b->oldtail, false);
                b->oldtail = NULL;
        }
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3263,6 +3263,11 @@ BBPdestroy(BAT *b)
                HEAPdecref(b->tvheap, false);
                b->tvheap = NULL;
        }
+       if (b->oldtail) {
+               ATOMIC_AND(&b->oldtail->refs, ~DELAYEDREMOVE);
+               HEAPdecref(b->oldtail, true);
+               b->oldtail = NULL;
+       }
        BATdelete(b);
 
        BBPclear(b->batCacheid);        /* if destroyed; de-register from BBP */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to