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

Modified Files:
        mal_instruction.mx 
Log Message:
Garbage collect instructions not used anymore.


Index: mal_instruction.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_instruction.mx,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -d -r1.286 -r1.287
--- mal_instruction.mx  4 Sep 2007 07:40:35 -0000       1.286
+++ mal_instruction.mx  31 Oct 2007 07:15:24 -0000      1.287
@@ -28,7 +28,7 @@
 Furthermore, a MAL program is considered a specification
 of intended computation and data flow behavior. It should be
 understood that its actual evaluation depends on the execution
-paradigm choosen in the scenario. The program blocks can both
+paradigm choosen in a scenario. The program blocks can both
 be interpreted as ordered sequences of assembler instructions,
 or as a representation of a data-flow graph that should be resolved
 in a dataflow driven manner.
@@ -671,13 +671,17 @@
 {
        int i;
 
-       for (i = 0; i < mb->stop; i++) {
-               freeInstruction(getInstrPtr(mb, i));
+       for (i = 0; i < mb->ssize; i++) 
+       if( mb->stmt[i]){
+               freeInstruction(mb->stmt[i]);
                mb->stmt[i] = NULL;
        }
        mb->stop = 0;
-       for (i = 0; i < mb->vtop; i++)
+       for (i = 0; i < mb->vsize; i++)
+       if( mb->var[i]){
                freeVariable(mb, i);
+               mb->var[i]=0;
+       }
        mb->vtop = 0;
        GDKfree(mb->stmt);
        mb->stmt = 0;
@@ -2054,7 +2058,7 @@
                        showException(MAL, "pushInstruction", "out of memory 
(requested: %d bytes)", space);
                        return;
                }
-               memcpy(newblk, mb->stmt, mb->stop * sizeof(InstrPtr));
+               memcpy(newblk, mb->stmt, mb->ssize * sizeof(InstrPtr));
 
                mb->ssize += STMT_INCREMENT;
                GDKfree(mb->stmt);


-------------------------------------------------------------------------
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