Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15548

Modified Files:
        opt_joinselect.mx opt_singleton.mx 
Log Message:
Minor changes to avoid some leakage.


Index: opt_joinselect.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_joinselect.mx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- opt_joinselect.mx   17 Aug 2007 13:56:54 -0000      1.12
+++ opt_joinselect.mx   31 Oct 2007 10:45:41 -0000      1.13
@@ -46,7 +46,7 @@
 OPTjoinselectImplementation(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        InstrPtr p, *old, qs, qi, qu, qd, r, d, k;
-       int i, limit, attr;
+       int i, limit, slimit, attr;
        int start = -1;
        int *scr_s, *scr_i, *scr_u, *scr_d;
        int *ps, *pi, *pu, *pd;
@@ -67,9 +67,10 @@
        (void) pci;
        setLifespan(mb);
        limit = mb->stop;
+       slimit = mb->ssize;
        old = mb->stmt;
 
-       newMalBlkStmt(mb, mb->stop);
+       newMalBlkStmt(mb, mb->ssize);
        
        /* The first loop identifies all the select calls and keeps a reference 
                to the operations.
@@ -135,6 +136,9 @@
                if (start == -1)
                        pushInstruction(mb, p);
        }
+       for( ; i<slimit; i++)
+       if( old[i])
+               freeInstruction(old[i]);
 
        /*Nothing to optimize*/
        if (start== -1) goto end;

Index: opt_singleton.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_singleton.mx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- opt_singleton.mx    17 Aug 2007 13:56:56 -0000      1.14
+++ opt_singleton.mx    31 Oct 2007 10:45:41 -0000      1.15
@@ -140,7 +140,7 @@
 static int
 STevaluate(MalBlkPtr mb, int cnt, int *vars)
 {
-       int i, j = 0, k, limit, actions = 0;
+       int i, j = 0, k, limit, slimit, actions = 0;
        InstrPtr p;
        InstrPtr *old;
        STtuple *tuples;
@@ -150,6 +150,7 @@
                return 0;
        tuples = alloca(mb->stop * sizeof(STtuple));
        limit = mb->stop;
+       slimit = mb->ssize;
        old = mb->stmt;
 
 @-
@@ -166,7 +167,7 @@
        printFunction(GDKout, mb, LIST_MAL_ALL);
        stream_printf(GDKout, "START OPTIMIZER ");
 #endif
-       newMalBlkStmt(mb, mb->stop);
+       newMalBlkStmt(mb, mb->ssize);
 
        for (i = 0; i < limit; i++) {
                p = old[i];
@@ -309,6 +310,10 @@
                }
                pushInstruction(mb, p);
        }
+       for(; i<slimit; i++)
+       if( old[i])
+               freeInstruction(old[i]);
+       GDKfree(old);
 #ifdef DEBUG_OPT_SINGLETON
        if (actions) {
                printf("FINAL STAGE actions=%d\n", actions);
@@ -318,7 +323,6 @@
                stream_printf(GDKout, "\n");
        }
 #endif
-       GDKfree(old);
 
 #ifdef DEBUG_OPT_SINGLETON
        printf("FINAL STAGE SINGLETON errors=%d\n", mb->errors);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to