#ifdef DMALLOC
#include "dmalloc.h"
#endif
+extern void * curr_heapbase;
+extern void * curr_heapptr;
+extern void * curr_heapgcpoint;
+extern void * curr_heaptop;
+
+extern void * to_heapbase;
+extern void * to_heapptr;
+extern void * to_heaptop;
+
#define MALLOCSIZE 20*1024
#endif
struct RuntimeHash *todo=allocateRuntimeHash(100);
int i;
+
for(i=0;i<numparams;i++) {
void * objptr=srcpointer[i];
if (RuntimeHashcontainskey(forward, (int) objptr))
livecount=((livecount-1)/OBJECTARRAYINTERVAL+1)*OBJECTARRAYINTERVAL;
aonew=(struct ArrayObject *) tomalloc(sizeof(struct ArrayObject)+sizeof(struct ___Object___*)*livecount);
+ memcpy(aonew, ao, sizeof(struct ArrayObject));
aonew->type=OBJECTARRAYTYPE;
aonew->___length___=livecount;
copy->flagptr=aonew;
}
}
aonew->___cachedCode___=k;
-
+ for(;k<livecount;k++) {
+ ARRAYSET(aonew, struct ___Object___*, k, NULL);
+ }
} else {
/* No object live anymore */
copy->flagptr=NULL;
int fd=VAR(___this___)->___fd___;
char * charstr=((char *)& VAR(___b___)->___length___)+sizeof(int)+offset;
while(1) {
- int bytewritten=write(fd, charstr, length);
- if (bytewritten==-1&&errno==EAGAIN)
- continue;
+ int offset=0;
+ int bytewritten;
+ while(length>0) {
+ bytewritten=write(fd, &charstr[offset], length);
+ if (bytewritten==-1&&errno!=EAGAIN)
+ break;
+ length-=bytewritten;
+ offset+=bytewritten;
+ }
- if (bytewritten!=length) {
+ if (length!=0) {
perror("ERROR IN NATIVEWRITE");
- printf("Supposed to write %d, wrote %d\n", length, bytewritten);
+ printf("error=%d remaining bytes %d\n",errno, length);
}
break;
}