Changeset: 7b1bd0073a62 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7b1bd0073a62
Modified Files:
        monetdb5/mal/mal_resource.c
Branch: Jul2021
Log Message:

Protect heap access.


diffs (21 lines):

diff --git a/monetdb5/mal/mal_resource.c b/monetdb5/mal/mal_resource.c
--- a/monetdb5/mal/mal_resource.c
+++ b/monetdb5/mal/mal_resource.c
@@ -67,7 +67,9 @@ getMemoryClaim(MalBlkPtr mb, MalStkPtr s
                b = BATdescriptor( stk->stk[getArg(pci, i)].val.bval);
                if (b == NULL)
                        return 0;
+               MT_lock_set(&b->theaplock);
                if (flag && isVIEW(b)) {
+                       MT_lock_unset(&b->theaplock);
                        BBPunfix(b->batCacheid);
                        return 0;
                }
@@ -75,6 +77,7 @@ getMemoryClaim(MalBlkPtr mb, MalStkPtr s
                /* calculate the basic scan size */
                total += BATcount(b) << b->tshift;
                total += heapinfo(b->tvheap, b->batCacheid);
+               MT_lock_unset(&b->theaplock);
 
                /* indices should help, find their maximum footprint */
                MT_rwlock_rdlock(&b->thashlock);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to