From 2bdac2732973de7846e90887a4122b53d2f7a06c Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 8 Nov 2007 07:47:48 +0000 Subject: [PATCH] more changes --- Robust/src/Runtime/checkpoint.c | 10 ++++++++++ Robust/src/Runtime/garbage.c | 5 ++++- Robust/src/Runtime/socket.c | 16 +++++++++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Robust/src/Runtime/checkpoint.c b/Robust/src/Runtime/checkpoint.c index 7fe10c42..4e716ea0 100644 --- a/Robust/src/Runtime/checkpoint.c +++ b/Robust/src/Runtime/checkpoint.c @@ -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;itype=OBJECTARRAYTYPE; aonew->___length___=livecount; copy->flagptr=aonew; @@ -363,7 +364,9 @@ void fixtags() { } } aonew->___cachedCode___=k; - + for(;kflagptr=NULL; diff --git a/Robust/src/Runtime/socket.c b/Robust/src/Runtime/socket.c index e550a76a..13b0ed02 100644 --- a/Robust/src/Runtime/socket.c +++ b/Robust/src/Runtime/socket.c @@ -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; } -- 2.34.1