From b4a4c09527834272013ecb409dcda809d19b02c4 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 8 Apr 2009 01:20:51 +0000 Subject: [PATCH] bug fixes --- Robust/src/Analysis/Locality/LocalityBinding.java | 8 ++------ Robust/src/IR/Flat/BuildCode.java | 6 +++--- Robust/src/Runtime/DSTM/interface/clookup.c | 1 + Robust/src/Runtime/garbage.c | 5 +++-- Robust/src/Runtime/socket.c | 12 ++++++------ 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Robust/src/Analysis/Locality/LocalityBinding.java b/Robust/src/Analysis/Locality/LocalityBinding.java index 7e1647a0..132bdfb6 100644 --- a/Robust/src/Analysis/Locality/LocalityBinding.java +++ b/Robust/src/Analysis/Locality/LocalityBinding.java @@ -131,14 +131,10 @@ public class LocalityBinding { if (isglobal.length!=lb.isglobal.length) return false; for(int i=0; i"+oidstr+"):0);"); } if (wb.needBarrier(fsfn)) output.println("*((unsigned int *)&("+dst+"->___objstatus___))|=DIRTY;"); - if (srcptr) { + if (srcptr&!fsfn.getSrc().getType().isNull()) { output.println("*((unsigned int *)&("+dst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;"); output.println("}"); } else { @@ -2380,7 +2380,7 @@ public class BuildCode { //Transaction set element case if (wb.needBarrier(fsen)) output.println("*((unsigned int *)&("+generateTemp(fm,fsen.getDst(),lb)+"->___objstatus___))|=DIRTY;"); - if (fsen.getSrc().getType().isPtr()) { + if (fsen.getSrc().getType().isPtr()&&!fsen.getSrc().getType().isNull()) { output.println("{"); String src=generateTemp(fm, fsen.getSrc(), lb); output.println("int srcoid=("+src+"!=NULL?((int)"+src+"->"+oidstr+"):0);"); diff --git a/Robust/src/Runtime/DSTM/interface/clookup.c b/Robust/src/Runtime/DSTM/interface/clookup.c index 28dda702..d2ec50a9 100644 --- a/Robust/src/Runtime/DSTM/interface/clookup.c +++ b/Robust/src/Runtime/DSTM/interface/clookup.c @@ -338,4 +338,5 @@ void t_chashDelete() { } } free(ptr); + c_table=NULL; } diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 0f6938bd..11984fa9 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -183,7 +183,7 @@ void fixtable(chashlistnode_t ** tc_table, unsigned int tc_size) { ENQUEUE(objptr, *((void **)(((int)ptr)+offset))); } } - } + } next = curr->next; index = (((unsigned int)key) & mask) >>1; @@ -281,7 +281,8 @@ void collect(struct garbagelist * stackptr) { ENQUEUE(orig, listptr->locklist); #endif #ifdef STM - fixtable(listptr->tc_table, listptr->tc_size); + if ((*listptr->tc_table)!=NULL) + fixtable(listptr->tc_table, listptr->tc_size); #endif stackptr=listptr->stackptr; listptr=listptr->next; diff --git a/Robust/src/Runtime/socket.c b/Robust/src/Runtime/socket.c index e9c3abef..9adbd2e9 100644 --- a/Robust/src/Runtime/socket.c +++ b/Robust/src/Runtime/socket.c @@ -26,7 +26,7 @@ int CALL24(___Socket______nativeConnect____I__AR_B_I, int ___fd___, int ___port_ sin.sin_family= AF_INET; sin.sin_port=htons(___port___); sin.sin_addr.s_addr=htonl(*(int *)(((char *)&VAR(___address___)->___length___)+sizeof(int))); -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC struct listitem *tmp=stopforgc((struct garbagelist *)___params___); #endif @@ -34,7 +34,7 @@ int CALL24(___Socket______nativeConnect____I__AR_B_I, int ___fd___, int ___port_ do { rc = connect(___fd___, (struct sockaddr *) &sin, sizeof(sin)); } while (rc<0 && errno==EINTR); /* repeat if interrupted */ -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC restartaftergc(tmp); #endif @@ -293,7 +293,7 @@ int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSo unsigned int sinlen=sizeof(sin); int fd=VAR(___this___)->___fd___; int newfd; -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC struct listitem *tmp=stopforgc((struct garbagelist *)___params___); #endif @@ -301,7 +301,7 @@ int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSo newfd=accept(fd, (struct sockaddr *)&sin, &sinlen); int flag = 1; setsockopt(newfd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(flag)); -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC restartaftergc(tmp); #endif @@ -369,7 +369,7 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, char * charstr=malloc(length); -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC struct listitem *tmp=stopforgc((struct garbagelist *)___params___); #endif @@ -380,7 +380,7 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, do { byteread=read(fd, charstr, length); } while(byteread==-1&&errno==EINTR); -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC restartaftergc(tmp); #endif -- 2.34.1