Changeset: 4dc78c54d28f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4dc78c54d28f
Modified Files:
        monetdb5/mal/mal.c
        monetdb5/mal/mal_runtime.c
        monetdb5/mal/mal_runtime.h
Branch: default
Log Message:

Don't expose dropQRYqueue, but embed it in mal_runtime_reset, which does the 
grand final clean up of mal_runtime


diffs (70 lines):

diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -98,7 +98,6 @@ void mal_reset(void)
 {
        GDKprepareExit();
        MCstopClients(0);
-       dropQRYqueue();
        setHeartbeat(-1);
        stopProfiler(0);
        AUTHreset();
diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -30,17 +30,6 @@ QueryQueue QRYqueue = NULL;
 size_t qsize = 0, qhead = 0, qtail = 0;
 static oid qtag= 1;            // A unique query identifier
 
-void
-mal_runtime_reset(void)
-{
-       GDKfree(QRYqueue);
-       QRYqueue = NULL;
-       qsize = 0;
-       qtag= 1;
-       qhead = 0;
-       qtail = 0;
-}
-
 static str
 isaSQLquery(MalBlkPtr mb){
        int i;
@@ -104,7 +93,7 @@ advanceQRYqueue(void)
        }
 }
 
-void
+static void
 dropQRYqueue(void)
 {
        size_t i;
@@ -229,6 +218,17 @@ runtimeProfileFinish(Client cntxt, MalBl
        MT_lock_unset(&mal_delayLock);
 }
 
+/* Used by mal_reset to do the grand final clean up of this area before 
MonetDB exits */
+void
+mal_runtime_reset(void)
+{
+       dropQRYqueue();
+       qsize = 0;
+       qtag= 1;
+       qhead = 0;
+       qtail = 0;
+}
+
 /*
  * Each MAL instruction is executed by a single thread, which means we can
  * keep a simple working set around to make Stethscope attachement easy.
diff --git a/monetdb5/mal/mal_runtime.h b/monetdb5/mal/mal_runtime.h
--- a/monetdb5/mal/mal_runtime.h
+++ b/monetdb5/mal/mal_runtime.h
@@ -53,7 +53,6 @@ mal_export void runtimeProfileInit(Clien
 mal_export void runtimeProfileFinish(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk);
 mal_export void runtimeProfileBegin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci, RuntimeProfile prof);
 mal_export void runtimeProfileExit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci, RuntimeProfile prof);
-mal_export void dropQRYqueue(void);
 mal_export lng getVolume(MalStkPtr stk, InstrPtr pci, int rd);
 mal_export lng getBatSpace(BAT *b);
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to