outrepairstructs.println(" int __type__;");
printRepairStruct(typeutil.getClass(TypeUtil.ObjectClass), outrepairstructs);
outrepairstructs.println(" int length;");
- if (tdelement.isClass()||tdelement.isArray())
+ /*
+ // Need to add support to repair tool for this
+ if (tdelement.isClass()||tdelement.isArray())
outrepairstructs.println(" "+tdelement.getRepairSymbol()+" * elem[this.length];");
else
outrepairstructs.println(" "+tdelement.getRepairSymbol()+" elem[this.length];");
-
+ */
outrepairstructs.println("}\n");
}
else if (isClass())
return class_desc.getSymbol();
else if (isByte())
- return "char";
+ return "byte";
else if (isChar())
return "short";
else if (isShort())
#include <stdio.h>
/* SIMPLE HASH ********************************************************/
-struct SimpleIterator* SimpleHashcreateiterator(struct SimpleHash * thisvar) {
- return allocateSimpleIterator(thisvar->listhead,thisvar->listtail,thisvar->tailindex/*,thisvar*/);
+struct RuntimeIterator* RuntimeHashcreateiterator(struct RuntimeHash * thisvar) {
+ return allocateRuntimeIterator(thisvar->listhead,thisvar->listtail,thisvar->tailindex/*,thisvar*/);
}
-void SimpleHashiterator(struct SimpleHash *thisvar, struct SimpleIterator * it) {
+void RuntimeHashiterator(struct RuntimeHash *thisvar, struct RuntimeIterator * it) {
it->cur=thisvar->listhead;
it->index=0;
it->tailindex=thisvar->tailindex;
it->tail=thisvar->listtail;
}
-struct SimpleHash * noargallocateSimpleHash() {
- return allocateSimpleHash(100);
+struct RuntimeHash * noargallocateRuntimeHash() {
+ return allocateRuntimeHash(100);
}
-struct SimpleHash * allocateSimpleHash(int size) {
- struct SimpleHash *thisvar=(struct SimpleHash *)RUNMALLOC(sizeof(struct SimpleHash));
+struct RuntimeHash * allocateRuntimeHash(int size) {
+ struct RuntimeHash *thisvar=(struct RuntimeHash *)RUNMALLOC(sizeof(struct RuntimeHash));
if (size <= 0) {
printf("Negative Hashtable size Exception\n");
exit(-1);
}
thisvar->size = size;
- thisvar->bucket = (struct SimpleNode **) RUNMALLOC(sizeof(struct SimpleNode *)*size);
+ thisvar->bucket = (struct RuntimeNode **) RUNMALLOC(sizeof(struct RuntimeNode *)*size);
/* Set allocation blocks*/
- thisvar->listhead=(struct ArraySimple *) RUNMALLOC(sizeof(struct ArraySimple));
+ thisvar->listhead=(struct ArrayRuntime *) RUNMALLOC(sizeof(struct ArrayRuntime));
thisvar->listtail=thisvar->listhead;
thisvar->tailindex=0;
/*Set data counts*/
return thisvar;
}
-void freeSimpleHash(struct SimpleHash *thisvar) {
- struct ArraySimple *ptr=thisvar->listhead;
+void freeRuntimeHash(struct RuntimeHash *thisvar) {
+ struct ArrayRuntime *ptr=thisvar->listhead;
RUNFREE(thisvar->bucket);
while(ptr) {
- struct ArraySimple *next=ptr->nextarray;
+ struct ArrayRuntime *next=ptr->nextarray;
RUNFREE(ptr);
ptr=next;
}
RUNFREE(thisvar);
}
-inline int SimpleHashcountset(struct SimpleHash * thisvar) {
+inline int RuntimeHashcountset(struct RuntimeHash * thisvar) {
return thisvar->numelements;
}
-int SimpleHashfirstkey(struct SimpleHash *thisvar) {
- struct ArraySimple *ptr=thisvar->listhead;
+int RuntimeHashfirstkey(struct RuntimeHash *thisvar) {
+ struct ArrayRuntime *ptr=thisvar->listhead;
int index=0;
while((index==ARRAYSIZE)||!ptr->nodes[index].inuse) {
if (index==ARRAYSIZE) {
return ptr->nodes[index].key;
}
-int SimpleHashremove(struct SimpleHash *thisvar, int key, int data) {
+int RuntimeHashremove(struct RuntimeHash *thisvar, int key, int data) {
unsigned int hashkey = (unsigned int)key % thisvar->size;
- struct SimpleNode **ptr = &thisvar->bucket[hashkey];
+ struct RuntimeNode **ptr = &thisvar->bucket[hashkey];
int i;
while (*ptr) {
if ((*ptr)->key == key && (*ptr)->data == data) {
- struct SimpleNode *toremove=*ptr;
+ struct RuntimeNode *toremove=*ptr;
*ptr=(*ptr)->next;
toremove->inuse=0; /* Marked as unused */
return 0;
}
-void SimpleHashaddAll(struct SimpleHash *thisvar, struct SimpleHash * set) {
- struct SimpleIterator it;
- SimpleHashiterator(set, &it);
- while(hasNext(&it)) {
- int keyv=key(&it);
- int data=next(&it);
- SimpleHashadd(thisvar,keyv,data);
+void RuntimeHashaddAll(struct RuntimeHash *thisvar, struct RuntimeHash * set) {
+ struct RuntimeIterator it;
+ RuntimeHashiterator(set, &it);
+ while(RunhasNext(&it)) {
+ int keyv=Runkey(&it);
+ int data=Runnext(&it);
+ RuntimeHashadd(thisvar,keyv,data);
}
}
-int SimpleHashadd(struct SimpleHash * thisvar,int key, int data) {
+int RuntimeHashadd(struct RuntimeHash * thisvar,int key, int data) {
/* Rehash code */
unsigned int hashkey;
- struct SimpleNode **ptr;
+ struct RuntimeNode **ptr;
if (thisvar->numelements>=thisvar->size) {
int newsize=2*thisvar->size+1;
- struct SimpleNode ** newbucket = (struct SimpleNode **) RUNMALLOC(sizeof(struct SimpleNode *)*newsize);
+ struct RuntimeNode ** newbucket = (struct RuntimeNode **) RUNMALLOC(sizeof(struct RuntimeNode *)*newsize);
int i;
for(i=thisvar->size-1;i>=0;i--) {
- struct SimpleNode *ptr;
+ struct RuntimeNode *ptr;
for(ptr=thisvar->bucket[i];ptr!=NULL;) {
- struct SimpleNode * nextptr=ptr->next;
+ struct RuntimeNode * nextptr=ptr->next;
unsigned int newhashkey=(unsigned int)ptr->key % newsize;
ptr->next=newbucket[newhashkey];
newbucket[newhashkey]=ptr;
ptr = &((*ptr)->next);
}
if (thisvar->tailindex==ARRAYSIZE) {
- thisvar->listtail->nextarray=(struct ArraySimple *) RUNMALLOC(sizeof(struct ArraySimple));
+ thisvar->listtail->nextarray=(struct ArrayRuntime *) RUNMALLOC(sizeof(struct ArrayRuntime));
thisvar->tailindex=0;
thisvar->listtail=thisvar->listtail->nextarray;
}
return 1;
}
-bool SimpleHashcontainskey(struct SimpleHash *thisvar,int key) {
+bool RuntimeHashcontainskey(struct RuntimeHash *thisvar,int key) {
unsigned int hashkey = (unsigned int)key % thisvar->size;
- struct SimpleNode *ptr = thisvar->bucket[hashkey];
+ struct RuntimeNode *ptr = thisvar->bucket[hashkey];
while (ptr) {
if (ptr->key == key) {
/* we already have thisvar object
return false;
}
-bool SimpleHashcontainskeydata(struct SimpleHash *thisvar, int key, int data) {
+bool RuntimeHashcontainskeydata(struct RuntimeHash *thisvar, int key, int data) {
unsigned int hashkey = (unsigned int)key % thisvar->size;
- struct SimpleNode *ptr = thisvar->bucket[hashkey];
+ struct RuntimeNode *ptr = thisvar->bucket[hashkey];
while (ptr) {
if (ptr->key == key && ptr->data == data) {
/* we already have thisvar object
return false;
}
-int SimpleHashcount(struct SimpleHash *thisvar,int key) {
+int RuntimeHashcount(struct RuntimeHash *thisvar,int key) {
unsigned int hashkey = (unsigned int)key % thisvar->size;
int count = 0;
- struct SimpleNode *ptr = thisvar->bucket[hashkey];
+ struct RuntimeNode *ptr = thisvar->bucket[hashkey];
while (ptr) {
if (ptr->key == key) {
count++;
return count;
}
-struct SimpleHash * SimpleHashimageSet(struct SimpleHash *thisvar, int key) {
- struct SimpleHash * newset=allocateSimpleHash(2*SimpleHashcount(thisvar,key)+4);
+struct RuntimeHash * RuntimeHashimageSet(struct RuntimeHash *thisvar, int key) {
+ struct RuntimeHash * newset=allocateRuntimeHash(2*RuntimeHashcount(thisvar,key)+4);
unsigned int hashkey = (unsigned int)key % thisvar->size;
- struct SimpleNode *ptr = thisvar->bucket[hashkey];
+ struct RuntimeNode *ptr = thisvar->bucket[hashkey];
while (ptr) {
if (ptr->key == key) {
- SimpleHashadd(newset,ptr->data,ptr->data);
+ RuntimeHashadd(newset,ptr->data,ptr->data);
}
ptr = ptr->next;
}
return newset;
}
-int SimpleHashget(struct SimpleHash *thisvar, int key, int *data) {
+int RuntimeHashget(struct RuntimeHash *thisvar, int key, int *data) {
unsigned int hashkey = (unsigned int)key % thisvar->size;
- struct SimpleNode *ptr = thisvar->bucket[hashkey];
+ struct RuntimeNode *ptr = thisvar->bucket[hashkey];
while (ptr) {
if (ptr->key == key) {
*data = ptr->data;
return 0; /* failure */
}
-int SimpleHashcountdata(struct SimpleHash *thisvar,int data) {
+int RuntimeHashcountdata(struct RuntimeHash *thisvar,int data) {
int count = 0;
- struct ArraySimple *ptr = thisvar->listhead;
+ struct ArrayRuntime *ptr = thisvar->listhead;
while(ptr) {
if (ptr->nextarray) {
int i;
return count;
}
-inline struct SimpleIterator * noargallocateSimpleIterator() {
- return (struct SimpleIterator*)RUNMALLOC(sizeof(struct SimpleIterator));
+inline struct RuntimeIterator * noargallocateRuntimeIterator() {
+ return (struct RuntimeIterator*)RUNMALLOC(sizeof(struct RuntimeIterator));
}
-inline struct SimpleIterator * allocateSimpleIterator(struct ArraySimple *start, struct ArraySimple *tl, int tlindex) {
- struct SimpleIterator *thisvar=(struct SimpleIterator*)RUNMALLOC(sizeof(struct SimpleIterator));
+inline struct RuntimeIterator * allocateRuntimeIterator(struct ArrayRuntime *start, struct ArrayRuntime *tl, int tlindex) {
+ struct RuntimeIterator *thisvar=(struct RuntimeIterator*)RUNMALLOC(sizeof(struct RuntimeIterator));
thisvar->cur = start;
thisvar->index=0;
thisvar->tailindex=tlindex;
return thisvar;
}
-inline int hasNext(struct SimpleIterator *thisvar) {
+inline int RunhasNext(struct RuntimeIterator *thisvar) {
if (thisvar->cur==thisvar->tail &&
thisvar->index==thisvar->tailindex)
return 0;
return 0;
}
-inline int next(struct SimpleIterator *thisvar) {
+inline int Runnext(struct RuntimeIterator *thisvar) {
return thisvar->cur->nodes[thisvar->index++].data;
}
-inline int key(struct SimpleIterator *thisvar) {
+inline int Runkey(struct RuntimeIterator *thisvar) {
return thisvar->cur->nodes[thisvar->index].key;
}
/* SimpleHash *********************************************************/
-struct SimpleHash * noargallocateSimpleHash();
-struct SimpleHash * allocateSimpleHash(int size);
-void SimpleHashaddChild(struct SimpleHash *thisvar, struct SimpleHash * child);
-void freeSimpleHash(struct SimpleHash *);
-
-
-int SimpleHashadd(struct SimpleHash *, int key, int data);
-int SimpleHashremove(struct SimpleHash *,int key, int data);
-bool SimpleHashcontainskey(struct SimpleHash *,int key);
-bool SimpleHashcontainskeydata(struct SimpleHash *,int key, int data);
-int SimpleHashget(struct SimpleHash *,int key, int* data);
-int SimpleHashcountdata(struct SimpleHash *,int data);
-void SimpleHashaddParent(struct SimpleHash *,struct SimpleHash* parent);
-int SimpleHashfirstkey(struct SimpleHash *);
-struct SimpleIterator* SimpleHashcreateiterator(struct SimpleHash *);
-void SimpleHashiterator(struct SimpleHash *, struct SimpleIterator * it);
-int SimpleHashcount(struct SimpleHash *, int key);
-void SimpleHashaddAll(struct SimpleHash *, struct SimpleHash * set);
-struct SimpleHash * SimpleHashimageSet(struct SimpleHash *, int key);
-
-struct SimpleHash {
+struct RuntimeHash * noargallocateRuntimeHash();
+struct RuntimeHash * allocateRuntimeHash(int size);
+void RuntimeHashaddChild(struct RuntimeHash *thisvar, struct RuntimeHash * child);
+void freeRuntimeHash(struct RuntimeHash *);
+
+
+int RuntimeHashadd(struct RuntimeHash *, int key, int data);
+int RuntimeHashremove(struct RuntimeHash *,int key, int data);
+bool RuntimeHashcontainskey(struct RuntimeHash *,int key);
+bool RuntimeHashcontainskeydata(struct RuntimeHash *,int key, int data);
+int RuntimeHashget(struct RuntimeHash *,int key, int* data);
+int RuntimeHashcountdata(struct RuntimeHash *,int data);
+void RuntimeHashaddParent(struct RuntimeHash *,struct RuntimeHash* parent);
+int RuntimeHashfirstkey(struct RuntimeHash *);
+struct RuntimeIterator* RuntimeHashcreateiterator(struct RuntimeHash *);
+void RuntimeHashiterator(struct RuntimeHash *, struct RuntimeIterator * it);
+int RuntimeHashcount(struct RuntimeHash *, int key);
+void RuntimeHashaddAll(struct RuntimeHash *, struct RuntimeHash * set);
+struct RuntimeHash * RuntimeHashimageSet(struct RuntimeHash *, int key);
+
+struct RuntimeHash {
int numelements;
int size;
- struct SimpleNode **bucket;
- struct ArraySimple *listhead;
- struct ArraySimple *listtail;
+ struct RuntimeNode **bucket;
+ struct ArrayRuntime *listhead;
+ struct ArrayRuntime *listtail;
int tailindex;
};
-inline int SimpleHashcountset(struct SimpleHash * thisvar);
+inline int RuntimeHashcountset(struct RuntimeHash * thisvar);
-/* SimpleHashException *************************************************/
+/* RuntimeHashException *************************************************/
-/* SimpleIterator *****************************************************/
+/* RuntimeIterator *****************************************************/
#define ARRAYSIZE 100
-struct SimpleNode {
- struct SimpleNode *next;
+struct RuntimeNode {
+ struct RuntimeNode *next;
int data;
int key;
int inuse;
};
-struct ArraySimple {
- struct SimpleNode nodes[ARRAYSIZE];
- struct ArraySimple * nextarray;
+struct ArrayRuntime {
+ struct RuntimeNode nodes[ARRAYSIZE];
+ struct ArrayRuntime * nextarray;
};
-struct SimpleIterator {
- struct ArraySimple *cur, *tail;
+struct RuntimeIterator {
+ struct ArrayRuntime *cur, *tail;
int index,tailindex;
};
-inline struct SimpleIterator * noargallocateSimpleIterator();
+inline struct RuntimeIterator * noargallocateRuntimeIterator();
-inline struct SimpleIterator * allocateSimpleIterator(struct ArraySimple *start, struct ArraySimple *tl, int tlindex);
+inline struct RuntimeIterator * allocateRuntimeIterator(struct ArrayRuntime *start, struct ArrayRuntime *tl, int tlindex);
-inline int hasNext(struct SimpleIterator *thisvar);
+inline int RunhasNext(struct RuntimeIterator *thisvar);
-inline int next(struct SimpleIterator *thisvar);
+inline int Runnext(struct RuntimeIterator *thisvar);
-inline int key(struct SimpleIterator *thisvar);
+inline int Runkey(struct RuntimeIterator *thisvar);
#endif
#include "structdefs.h"
#include <string.h>
-void ** makecheckpoint(int numparams, void ** srcpointer, struct SimpleHash * forward, struct SimpleHash * reverse) {
+void ** makecheckpoint(int numparams, void ** srcpointer, struct RuntimeHash * forward, struct RuntimeHash * reverse) {
void **newarray=RUNMALLOC(sizeof(void *)*numparams);
- struct SimpleHash *todo=allocateSimpleHash(100);
+ struct RuntimeHash *todo=allocateRuntimeHash(100);
int i;
for(i=0;i<numparams;i++) {
void * objptr=srcpointer[i];
- if (SimpleHashcontainskey(forward, (int) objptr))
- SimpleHashget(forward,(int) objptr,(int *) &newarray[i]);
+ if (RuntimeHashcontainskey(forward, (int) objptr))
+ RuntimeHashget(forward,(int) objptr,(int *) &newarray[i]);
else {
void * copy=createcopy(objptr);
- SimpleHashadd(forward, (int) objptr, (int)copy);
- SimpleHashadd(reverse, (int) copy, (int) objptr);
- SimpleHashadd(todo, (int) objptr, (int) objptr);
+ RuntimeHashadd(forward, (int) objptr, (int)copy);
+ RuntimeHashadd(reverse, (int) copy, (int) objptr);
+ RuntimeHashadd(todo, (int) objptr, (int) objptr);
newarray[i]=copy;
}
}
- while(SimpleHashcountset(todo)!=0) {
- void * ptr=(void *) SimpleHashfirstkey(todo);
+ while(RuntimeHashcountset(todo)!=0) {
+ void * ptr=(void *) RuntimeHashfirstkey(todo);
int type=((int *)ptr)[0];
- SimpleHashremove(todo, (int) ptr, (int) ptr);
+ RuntimeHashremove(todo, (int) ptr, (int) ptr);
{
void *cpy;
- SimpleHashget(forward, (int) ptr, (int *) &cpy);
+ RuntimeHashget(forward, (int) ptr, (int *) &cpy);
int * pointer=pointerarray[type];
if (pointer==0) {
/* Array of primitives */
int i;
for(i=0;i<length;i++) {
void *objptr=((void **)(((char *)& ao->___length___)+sizeof(int)))[i];
- if (SimpleHashcontainskey(forward, (int) objptr))
- SimpleHashget(forward,(int) objptr,(int *) &((void **)(((char *)& ao->___length___)+sizeof(int)))[i]);
+ if (RuntimeHashcontainskey(forward, (int) objptr))
+ RuntimeHashget(forward,(int) objptr,(int *) &((void **)(((char *)& ao->___length___)+sizeof(int)))[i]);
else {
void * copy=createcopy(objptr);
- SimpleHashadd(forward, (int) objptr, (int)copy);
- SimpleHashadd(reverse, (int) copy, (int) objptr);
- SimpleHashadd(todo, (int) objptr, (int) objptr);
+ RuntimeHashadd(forward, (int) objptr, (int)copy);
+ RuntimeHashadd(reverse, (int) copy, (int) objptr);
+ RuntimeHashadd(todo, (int) objptr, (int) objptr);
((void **)(((char *)& ao->___length___)+sizeof(int)))[i]=copy;
}
}
for(i=1;i<=size;i++) {
int offset=pointer[i];
void * objptr=*((void **)(((int)ptr)+offset));
- if (SimpleHashcontainskey(forward, (int) objptr))
- SimpleHashget(forward, (int) objptr, (int *) &(((char *)cpy)[offset]));
+ if (RuntimeHashcontainskey(forward, (int) objptr))
+ RuntimeHashget(forward, (int) objptr, (int *) &(((char *)cpy)[offset]));
else {
void * copy=createcopy(objptr);
- SimpleHashadd(forward, (int) objptr, (int) copy);
- SimpleHashadd(reverse, (int) copy, (int) objptr);
- SimpleHashadd(todo, (int) objptr, (int) objptr);
+ RuntimeHashadd(forward, (int) objptr, (int) copy);
+ RuntimeHashadd(reverse, (int) copy, (int) objptr);
+ RuntimeHashadd(todo, (int) objptr, (int) objptr);
*((void **) (((int)cpy)+offset))=copy;
}
}
}
}
-void restorecheckpoint(int numparams, void ** original, void ** checkpoint, struct SimpleHash *forward, struct SimpleHash * reverse) {
- struct SimpleHash *todo=allocateSimpleHash(100);
+void restorecheckpoint(int numparams, void ** original, void ** checkpoint, struct RuntimeHash *forward, struct RuntimeHash * reverse) {
+ struct RuntimeHash *todo=allocateRuntimeHash(100);
int i;
for(i=0;i<numparams;i++) {
- SimpleHashadd(todo, (int) checkpoint[i], (int) checkpoint[i]);
+ RuntimeHashadd(todo, (int) checkpoint[i], (int) checkpoint[i]);
}
- while(SimpleHashcountset(todo)!=0) {
- void * ptr=(void *) SimpleHashfirstkey(todo);
+ while(RuntimeHashcountset(todo)!=0) {
+ void * ptr=(void *) RuntimeHashfirstkey(todo);
int type=((int *)ptr)[0];
- SimpleHashremove(todo, (int) ptr, (int) ptr);
+ RuntimeHashremove(todo, (int) ptr, (int) ptr);
{
void *cpy;
- SimpleHashget(reverse, (int) ptr, (int *) &cpy);
+ RuntimeHashget(reverse, (int) ptr, (int *) &cpy);
int * pointer=pointerarray[type];
if (pointer==0) {
/* Array of primitives */
int i;
for(i=0;i<length;i++) {
void *objptr=((void **)(((char *)& ao->___length___)+sizeof(int)))[i];
- SimpleHashget(reverse, (int) objptr, (int *) &((void **)(((char *)& ao->___length___)+sizeof(int)))[i]);
+ RuntimeHashget(reverse, (int) objptr, (int *) &((void **)(((char *)& ao->___length___)+sizeof(int)))[i]);
}
} else {
int size=pointer[0];
for(i=1;i<=size;i++) {
int offset=pointer[i];
void * objptr=*((void **)(((int)ptr)+offset));
- SimpleHashget(reverse, (int) objptr, (int *) &(((char *)cpy)[offset]));
+ RuntimeHashget(reverse, (int) objptr, (int *) &(((char *)cpy)[offset]));
}
}
}
#define CHECKPOINT_H
#include "SimpleHash.h"
-void ** makecheckpoint(int numparams, void ** pointerarray, struct SimpleHash * forward, struct SimpleHash * reverse);
+void ** makecheckpoint(int numparams, void ** pointerarray, struct RuntimeHash * forward, struct RuntimeHash * reverse);
-void restorecheckpoint(int numparams, void ** original, void ** checkpoint, struct SimpleHash *forward, struct SimpleHash * reverse);
+void restorecheckpoint(int numparams, void ** original, void ** checkpoint, struct RuntimeHash *forward, struct RuntimeHash * reverse);
void * createcopy(void * orig);
void flagorand(void * ptr, int ormask, int andmask) {
int flag=((int *)ptr)[1];
- struct SimpleHash *flagptr=(struct SimpleHash *)(((int*)ptr)[2]);
+ struct RuntimeHash *flagptr=(struct RuntimeHash *)(((int*)ptr)[2]);
flag|=ormask;
flag&=andmask;
((int*)ptr)[1]=flag;
/*Remove from all queues */
while(flagptr!=NULL) {
- struct SimpleHash *next;
- SimpleHashget(flagptr, (int) ptr, (int *) &next);
- SimpleHashremove(flagptr, (int)ptr, (int) next);
+ struct RuntimeHash *next;
+ RuntimeHashget(flagptr, (int) ptr, (int *) &next);
+ RuntimeHashremove(flagptr, (int)ptr, (int) next);
flagptr=next;
}
struct QueueItem *tmpptr;
struct parameterwrapper * parameter=objectqueues[((int *)ptr)[0]];
int i;
- struct SimpleHash * prevptr=NULL;
+ struct RuntimeHash * prevptr=NULL;
while(parameter!=NULL) {
for(i=0;i<parameter->numberofterms;i++) {
int andmask=parameter->intarray[i*2];
int checkmask=parameter->intarray[i*2+1];
if ((flag&andmask)==checkmask) {
- SimpleHashadd(parameter->objectset, (int) ptr, (int) prevptr);
+ RuntimeHashadd(parameter->objectset, (int) ptr, (int) prevptr);
prevptr=parameter->objectset;
{
- struct SimpleIterator iteratorarray[MAXTASKPARAMS];
+ struct RuntimeIterator iteratorarray[MAXTASKPARAMS];
void * taskpointerarray[MAXTASKPARAMS];
int j;
int numparams=parameter->task->numParameters;
taskpointerarray[j]=ptr;
newindex=j;
} else {
- SimpleHashiterator(pw->objectset, &iteratorarray[j]);
- if (hasNext(&iteratorarray[j]))
- taskpointerarray[j]=(void *) next(&iteratorarray[j]);
+ RuntimeHashiterator(pw->objectset, &iteratorarray[j]);
+ if (RunhasNext(&iteratorarray[j]))
+ taskpointerarray[j]=(void *) Runnext(&iteratorarray[j]);
else
break; /* No tasks to dispatch */
}
done=0;
continue;
}
- if (hasNext(&iteratorarray[j])) {
- taskpointerarray[j]=(void *) next(&iteratorarray[j]);
+ if (RunhasNext(&iteratorarray[j])) {
+ taskpointerarray[j]=(void *) Runnext(&iteratorarray[j]);
break;
} else if ((j+1)!=numparams) {
- SimpleHashiterator(task->descriptorarray[j]->queue, &iteratorarray[j]);
+ RuntimeHashiterator(task->descriptorarray[j]->queue, &iteratorarray[j]);
} else {
done=0;
break;
}
parameter=parameter->next;
}
- ((struct SimpleHash **)ptr)[2]=prevptr;
+ ((struct RuntimeHash **)ptr)[2]=prevptr;
}
}
void * parameter=tpd->parameterArray[i];
struct parameterdescriptor * pd=tpd->task->descriptorarray[i];
struct parameterwrapper *pw=(struct parameterwrapper *) pd->queue;
- if (!SimpleHashcontainskey(pw->objectset, (int) parameter))
+ if (!RuntimeHashcontainskey(pw->objectset, (int) parameter))
goto newtask;
taskpointerarray[i]=parameter;
}
{
- struct SimpleHash * forward=allocateSimpleHash(100);
- struct SimpleHash * reverse=allocateSimpleHash(100);
+ struct RuntimeHash * forward=allocateRuntimeHash(100);
+ struct RuntimeHash * reverse=allocateRuntimeHash(100);
void ** checkpoint=makecheckpoint(tpd->task->numParameters, taskpointerarray, forward, reverse);
if (setjmp(error_handler)) {
/* Recover */
struct parameterwrapper ** ptr=&objectqueues[param->type];
param->queue=parameter;
- parameter->objectset=allocateSimpleHash(10);
+ parameter->objectset=allocateRuntimeHash(10);
parameter->numberofterms=param->numberterms;
parameter->intarray=param->intarray;
parameter->task=task;
struct parameterwrapper {
struct parameterwrapper *next;
- struct SimpleHash * objectset;
+ struct RuntimeHash * objectset;
int numberofterms;
int * intarray;
struct taskdescriptor * task;
mkdir $BUILDDIR
java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
$ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -struct $MAINFILE -struct \
-structfile.struct -task $@
+structfile -task $@
# Build all of the consistency specs
for i in *
do
cd $SPECDIR/$i
-cp $BUILDDIR/structfile.struct $i.struct
+cat $BUILDDIR/structfile.struct $i.label > $i.struct
java -cp $REPAIRROOT/:. MCC.Compiler -checkonly $i
+ls
cp size.[c,h] $BUILDDIR/specdir
-cp $i.c $i_aux.[c,h] $BUILDDIR/specdir
+cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
echo $i >> $BUILDDIR/specs
done
#compile C code
cd $BUILDDIR/specdir
-./buildruntime
+./buildrobust
for i in `cat $BUILDDIR/specs`
do
-gcc -O0 -g -c $i.c
+gcc -O0 -g -c $i\_aux.c
done
#build and link everything
+cd $CURDIR
gcc -I$ROBUSTROOT/Runtime -I. -IRuntime/include -Itmpbuilddirectory \
-O0 -DBOEHM_GC -LRuntime/lib/ -lgc -DTASK -g \
tmpbuilddirectory/methods.c tmpbuilddirectory/taskdefs.c \