Changeset: a1c6a69e173c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1c6a69e173c
Modified Files:
monetdb5/scheduler/run_mutation.c
Branch: mutation
Log Message:
Adjust the profiler and stack upon need.
Mutated plans require larger stacks and profiler admins.
diffs (49 lines):
diff --git a/monetdb5/scheduler/run_mutation.c
b/monetdb5/scheduler/run_mutation.c
--- a/monetdb5/scheduler/run_mutation.c
+++ b/monetdb5/scheduler/run_mutation.c
@@ -162,7 +162,7 @@ RUNtoggleMutation(MalBlkPtr mb)
static str
RUNmutationInternal(Client cntxt, MalStkPtr stk, str modnme, str fcnnme)
{
- int i, target = 0;
+ int i, target = 0, stop, vtop;
Mutant mutant;
MalBlkPtr src=0;
InstrPtr p;
@@ -228,6 +228,8 @@ RUNmutationInternal(Client cntxt, MalStk
}
/* At this point we have a target instruction to be replaced */
/* safe the previous version in the history list */
+ stop = src->stop;
+ vtop = src->vtop;
if ( mutationCandidate(src, p = getInstrPtr(src, target)) ){
/* add the mutation to the collection */
@@ -246,13 +248,26 @@ RUNmutationInternal(Client cntxt, MalStk
mutationSum(cntxt,mutant, target);
src = mutant->src;
- /* reset the profiler */
+ /* reset/expand the profiler */
+ if ( stop < src->stop){
+ GDKfree(src->profiler);
+ src->profiler = 0;
+ initProfiler(src);
+ }
for( i = 0; i < src->stop; i++)
src->profiler[i].ticks = 0;
+
+ /* initialize the possibly expanded stack frame */
+ if ( vtop < src->vtop){
+ stk= (MalStkPtr) GDKrealloc(stk, stackSize(src->vtop) +
sizeof(MalStack));
+ for (i = vtop ; i< src->vtop; i++)
+ stk->stk[i].val.lval = 0;
+ }
src->calls = 0;
DEBUG_MUTATION
printFunction(cntxt->fdout, src,0,LIST_MAL_ALL);
}
+ /* if necessary expand the stack and performance table */
// turn off the scheduler call
RUNtoggleMutation(src);
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list