more changes
authorbdemsky <bdemsky>
Thu, 8 Nov 2007 07:47:48 +0000 (07:47 +0000)
committerbdemsky <bdemsky>
Thu, 8 Nov 2007 07:47:48 +0000 (07:47 +0000)
Robust/src/Runtime/checkpoint.c
Robust/src/Runtime/garbage.c
Robust/src/Runtime/socket.c

index 7fe10c42fc10f1791140a2710fa647f2354ce4af..4e716ea0736a0a3e5ef60cd438ca2dd9d8983802 100644 (file)
@@ -5,6 +5,15 @@
 #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
 
@@ -51,6 +60,7 @@ void ** makecheckpoint(int numparams, void ** srcpointer, struct RuntimeHash * f
 #endif
   struct RuntimeHash *todo=allocateRuntimeHash(100);
   int i;
+
   for(i=0;i<numparams;i++) {
     void * objptr=srcpointer[i];
     if (RuntimeHashcontainskey(forward, (int) objptr))
index 7ead1fb476bd599c01debd1da5339f8ee4b7d3d9..16aca4c23a0f823b32bc5f1c987ddf314148e0a7 100644 (file)
@@ -352,6 +352,7 @@ void fixtags() {
        
        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;
@@ -363,7 +364,9 @@ void fixtags() {
          }
        }
        aonew->___cachedCode___=k;
-       
+       for(;k<livecount;k++) {
+         ARRAYSET(aonew, struct ___Object___*, k, NULL);
+       }
       } else {
        /* No object live anymore */
        copy->flagptr=NULL;
index e550a76a1276f3024c67aec1367e96d4d3473e54..13b0ed02af3ff003cf0b2055b5bf8e24b3ac7a6a 100644 (file)
@@ -292,13 +292,19 @@ void CALL24(___Socket______nativeWrite_____AR_B_I_I, int offset, int length, str
   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;
   }