Changeset: e3c3f9c6ab18 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e3c3f9c6ab18
Modified Files:
        monetdb5/mal/mal_instruction.c
        monetdb5/optimizer/opt_mutation.c
Branch: mutation
Log Message:

Make mutation00 work.
The MAL realloc is needed to create space for injection of
the mutated instruction portions.


diffs (43 lines):

diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -152,14 +152,14 @@ resizeMalBlk(MalBlkPtr mb, int maxstmt, 
        if ( mb->ssize > maxstmt && mb->vsize > maxvar)
                return ;
 
-       (void) GDKrealloc(mb->stmt, maxstmt * sizeof(InstrPtr));
+       mb->stmt = (InstrPtr *) GDKrealloc(mb->stmt, maxstmt * 
sizeof(InstrPtr));
        if ( mb->stmt == NULL)
                GDKerror("resizeMalBlk:" MAL_MALLOC_FAIL);
        for ( i = mb->ssize; i < maxstmt; i++)
                mb->stmt[i] = 0;
        mb->ssize = maxstmt;
 
-       (void) GDKrealloc(mb->var, maxvar * sizeof (VarPtr));
+       mb->var = (VarPtr*) GDKrealloc(mb->var, maxvar * sizeof (VarPtr));
        if ( mb->var == NULL)
                GDKerror("resizeMalBlk:" MAL_MALLOC_FAIL);
        for( i = mb->vsize; i < maxvar; i++)
@@ -167,7 +167,7 @@ resizeMalBlk(MalBlkPtr mb, int maxstmt, 
        mb->vsize = maxvar;
 
        if ( mb->profiler){
-               (void) GDKrealloc(mb->profiler, maxstmt * sizeof(ProfRecord));
+               mb->profiler = (ProfRecord *) GDKrealloc(mb->profiler, maxstmt 
* sizeof(ProfRecord));
                if (mb->profiler == NULL)
                        GDKerror("resizeMalBlk:" MAL_MALLOC_FAIL);
        }
diff --git a/monetdb5/optimizer/opt_mutation.c 
b/monetdb5/optimizer/opt_mutation.c
--- a/monetdb5/optimizer/opt_mutation.c
+++ b/monetdb5/optimizer/opt_mutation.c
@@ -57,9 +57,6 @@ OPTmutationImplementation(Client cntxt, 
                        freeInstruction(old[i]);
        GDKfree(old);
        /* resize the symbol table */
-       slimit = mb->vtop;
-       for ( i = 0; i <limit; i++)
-               (void) newTmpVariable(mb,TYPE_any);
-       mb->vtop = slimit;
+       resizeMalBlk(mb, mb->ssize * 2, mb->vsize * 2);
        return 1;
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to