Changeset: c4f56132c947 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c4f56132c947
Modified Files:
monetdb5/mal/mal_factory.c
monetdb5/mal/mal_interpreter.mx
Branch: default
Log Message:
Merge with Aug2011 branch.
diffs (92 lines):
diff --git a/monetdb5/mal/mal_factory.c b/monetdb5/mal/mal_factory.c
--- a/monetdb5/mal/mal_factory.c
+++ b/monetdb5/mal/mal_factory.c
@@ -558,7 +558,7 @@ yieldFactory(MalBlkPtr mb, InstrPtr p, i
*/
str
-shutdownFactory(Client cntxt, MalBlkPtr mb, bit force)
+shutdownFactory(Client cntxt, MalBlkPtr mb)
{
Plant pl, plim;
@@ -571,7 +571,7 @@ shutdownFactory(Client cntxt, MalBlkPtr
pl->factory = 0;
if (pl->stk)
pl->stk->keepAlive = FALSE;
- if ( force && pl->stk) {
+ if ( pl->stk) {
garbageCollector(cntxt, mb, pl->stk,TRUE);
GDKfree(pl->stk);
}
@@ -611,7 +611,7 @@ shutdownFactoryByName(Client cntxt, Modu
}
stk = pl->stk;
MSresetVariables(cntxt, pl->factory, stk, 0);
- shutdownFactory(cntxt, pl->factory, 0);
+ shutdownFactory(cntxt, pl->factory);
freeStack(stk);
deleteSymbol(m,s);
return MAL_SUCCEED;
@@ -623,7 +623,7 @@ finishFactory(Client cntxt, MalBlkPtr mb
{
(void) pp;
(void) pc;
- return shutdownFactory(cntxt, mb,TRUE);
+ return shutdownFactory(cntxt, mb);
}
/*
diff --git a/monetdb5/mal/mal_factory.h b/monetdb5/mal/mal_factory.h
--- a/monetdb5/mal/mal_factory.h
+++ b/monetdb5/mal/mal_factory.h
@@ -38,7 +38,7 @@ mal_export str runFactory(Client cntxt,
mal_export int yieldResult(MalBlkPtr mb, InstrPtr p, int pc);
mal_export str yieldFactory(MalBlkPtr mb, InstrPtr p, int pc);
mal_export str finishFactory(Client cntxt, MalBlkPtr mb, InstrPtr pp, int pc);
-mal_export str shutdownFactory(Client cntxt, MalBlkPtr mb, bit force);
+mal_export str shutdownFactory(Client cntxt, MalBlkPtr mb);
mal_export str shutdownFactoryByName(Client cntxt, Module m,str nme);
mal_export str callFactory(Client cntxt, MalBlkPtr mb, ValPtr argv[],char
flag);
mal_export int factoryHasFreeSpace(void);
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -1595,7 +1595,7 @@ safeguardStack(Client cntxt, MalBlkPtr m
break;
case ENDsymbol:
if (getInstrPtr(mb, 0)->token == FACTORYsymbol)
- ret = shutdownFactory(cntxt, mb, 0);
+ ret = shutdownFactory(cntxt, mb);
#if @1
if (oldtimer)
cntxt->timer = oldtimer;
@@ -1723,13 +1723,16 @@ safeguardStack(Client cntxt, MalBlkPtr m
case YIELDsymbol: /* to be defined */
if (oldtimer)
cntxt->timer = oldtimer;
+ GDKfree(backup);
+ GDKfree(sbackup);
+ GDKfree(garbage);
return yieldFactory(mb, pci, stkpc);
case RETURNsymbol:
/* Return from factory involves cleanup */
if (getInstrPtr(mb, 0)->token == FACTORYsymbol) {
yieldResult(mb, pci, stkpc);
- shutdownFactory(cntxt, mb, TRUE);
+ shutdownFactory(cntxt, mb);
} else
/* a fake multi-assignment */
if (env != NULL && pcicaller != NULL) {
diff --git a/monetdb5/modules/mal/factories.mx
b/monetdb5/modules/mal/factories.mx
--- a/monetdb5/modules/mal/factories.mx
+++ b/monetdb5/modules/mal/factories.mx
@@ -187,6 +187,6 @@ FCTshutdown(Client cntxt, MalBlkPtr mb,
s = findSymbol(cntxt->nspace, putName(mod,strlen(mod)), putName(fcn,
strlen(fcn)));
if (s == NULL)
throw(MAL, "factories.shutdown", RUNTIME_OBJECT_MISSING);
- shutdownFactory(cntxt,s->def, TRUE);
+ shutdownFactory(cntxt,s->def);
return MAL_SUCCEED;
}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list