Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20417
Modified Files:
opt_macro.mx opt_remoteQueries.mx
Log Message:
Minor changes to avoid some leakage.
Index: opt_remoteQueries.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_remoteQueries.mx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- opt_remoteQueries.mx 17 Aug 2007 13:56:56 -0000 1.13
+++ opt_remoteQueries.mx 31 Oct 2007 12:31:54 -0000 1.14
@@ -242,7 +242,7 @@
OPTremoteQueriesImplementation(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
{
InstrPtr p, q, r, *old;
- int i, j, cnt, limit, doit=0;
+ int i, j, cnt, limit, slimit, doit=0;
int remoteSite,collectFirst;
int *location;
DBalias *dbalias;
@@ -261,6 +261,7 @@
setLifespan(mb);
limit = mb->stop;
+ slimit = mb->ssize;
old = mb->stmt;
location= alloca(mb->vsize * sizeof(int));
@@ -269,7 +270,7 @@
memset((char*) dbalias, 0, 128 * sizeof(DBalias));
dbtop= 0;
- newMalBlkStmt(mb, mb->stop);
+ newMalBlkStmt(mb, mb->ssize);
for (i = 0; i < limit; i++) {
p = old[i];
@@ -439,6 +440,9 @@
pushInstruction(mb,p);
}
}
+ for(; i<slimit; i++)
+ if( old[i])
+ freeInstruction(old[i]);
GDKfree(old);
#ifdef DEBUG_OPT_REMOTE
if (doit) {
Index: opt_macro.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_macro.mx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- opt_macro.mx 4 Sep 2007 07:41:29 -0000 1.21
+++ opt_macro.mx 31 Oct 2007 12:31:53 -0000 1.22
@@ -236,7 +236,7 @@
#endif
p = getInstrPtr(mb, pc);
q = getInstrPtr(mc, 0);
- ns = GDKmalloc((l = (mb->ssize + mc->ssize + p->retc - 3)) *
sizeof(InstrPtr));
+ ns = GDKzalloc((l = (mb->ssize + mc->ssize + p->retc - 3)) *
sizeof(InstrPtr));
nv = alloca(mc->vtop * sizeof(int));
/* add all variables of the new block to the target environment */
@@ -307,6 +307,12 @@
for (i = pc + 1; i < mb->stop; i++){
ns[k++] = mb->stmt[i];
}
+ /* remove any free instruction */
+ for(; i<mb->ssize; i++)
+ if( mb->stmt[i]){
+ freeInstruction(mb->stmt[i]);
+ mb->stmt[i]= 0;
+ }
GDKfree(mb->stmt);
mb->stmt = ns;
-------------------------------------------------------------------------
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