Changeset: bf4f66199fc4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bf4f66199fc4
Modified Files:
        sql/common/sql_mem.c
Branch: Dec2023
Log Message:

also cleanup frees/destroys from sub-allocator


diffs (24 lines):

diff --git a/sql/common/sql_mem.c b/sql/common/sql_mem.c
--- a/sql/common/sql_mem.c
+++ b/sql/common/sql_mem.c
@@ -72,6 +72,7 @@ sa_free(sql_allocator *pa, void *blk)
        } else {
                freed_t *f = blk;
                f->n = pa->freelist;
+               f->sz = sz;
 
                pa->freelist = f;
        }
@@ -211,8 +212,11 @@ void *sa_zalloc( sql_allocator *sa, size
 
 void sa_destroy( sql_allocator *sa )
 {
-       if (sa->pa)
+       if (sa->pa) {
+               sa_reset(sa);
+               sa_free(sa->pa, sa->blks[0]);
                return;
+       }
 
        sa_destroy_freelist(sa->freelist);
        for (size_t i = 0; i<sa->nr; i++) {
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to