struct malloclist {
struct malloclist *next;
int size;
+#ifdef RAW
+ char * space;
+#else
char space[];
+#endif
};
struct malloclist * top=NULL;
void * cpmalloc(int size) {
int endoffset=offset+size;
+ int tmpoffset=0;
if (top==NULL||endoffset>top->size) {
int basesize=MALLOCSIZE;
struct malloclist *tmp;
top->size=basesize;
offset=0;
}
- int tmpoffset=offset;
+ tmpoffset=offset;
offset+=size;
return &top->space[tmpoffset];
}
void checkvalid(void * ptr) {
if (ptr>=curr_heapbase&&ptr<=curr_heaptop) {
+#ifndef RAW
printf("Valid\n");
+#endif
}
}
int offset=pointer[i];
void * ptr=*(void **) (((int) data) + offset);
if (ptr!=NULL&&!RuntimeHashcontainskey(reverse, (int) ptr)) {
+#ifndef RAW
printf("Bad\n");
+#endif
}
checkvalid(ptr);
}
RuntimeHashiterator(reverse, &rit);
while(RunhasNext(&rit)) {
struct ___Object___ * data=(struct ___Object___*) Runkey(&rit);
+ int type=0;
+ unsigned int * pointer=NULL;
+ int size;
+ int i;
Runnext(&rit);
- int type=data->type;
- unsigned int * pointer=pointerarray[type];
- int size;
- int i;
+ type=data->type;
+ pointer=pointerarray[type];
if (pointer!=0&&((int)pointer)!=1) {
size=pointer[0];
for(i=1;i<=size;i++) {
int offset=pointer[i];
void * ptr=*(void **) (((int) data) + offset);
if (ptr!=NULL&&!RuntimeHashcontainskey(reverse, (int) ptr)) {
+#ifndef RAW
printf("Bad2\n");
+#endif
}
checkvalid(ptr);
}
RuntimeHashremove(todo, (int) ptr, (int) ptr);
{
void *cpy;
+ unsigned int * pointer=NULL;
RuntimeHashget(forward, (int) ptr, (int *) &cpy);
- unsigned int * pointer=pointerarray[type];
+ pointer=pointerarray[type];
#ifdef TASK
if (type==TAGTYPE) {
void *objptr=((struct ___TagDescriptor___*)ptr)->flagptr;