From 0f4a0a17e1fab8d37ad5040080cc79937bf70238 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 13 Apr 2011 08:03:44 +0000 Subject: [PATCH] make compiler work on mac... --- Robust/src/Runtime/garbage.c | 11 +++++++---- Robust/src/Runtime/thread.c | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index ad9ea2c2..35801dc3 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -871,12 +871,8 @@ void stopforgc(struct garbagelist * ptr) { #ifndef MAC litem.stackptr=ptr; #if defined(STM)||defined(THREADS)||defined(MLP) -#ifdef MAC - litem.base=pthread_getspecific(memorybasekey); -#else litem.base=&memorybase; #endif -#endif #ifdef STM litem.tc_size=c_size; litem.tc_table=&c_table; @@ -891,6 +887,9 @@ void stopforgc(struct garbagelist * ptr) { //handle MAC struct listitem *litem=pthread_getspecific(litemkey); litem->stackptr=ptr; +#if defined(STM)||defined(THREADS)||defined(MLP) + litem->base=pthread_getspecific(memorybasekey); +#endif #endif pthread_mutex_lock(&gclistlock); listcount++; @@ -935,6 +934,10 @@ void * mygcmalloc(struct garbagelist * stackptr, int size) { } char *retvalue=memorybase; memorybase+=size; +#ifdef MAC + *(char **)pthread_getspecific(memorybasekey)=memorybase; + *(char **)pthread_getspecific(memorytopkey)=memorytop; +#endif return retvalue; } diff --git a/Robust/src/Runtime/thread.c b/Robust/src/Runtime/thread.c index ba0d9b53..ef75f1c4 100644 --- a/Robust/src/Runtime/thread.c +++ b/Robust/src/Runtime/thread.c @@ -190,6 +190,7 @@ void initializethreads() { pthread_key_create(&threadlocks, NULL); pthread_key_create(&memorybasekey, NULL); pthread_key_create(&memorytopkey, NULL); + pthread_key_create(&litemkey, NULL); #endif processOptions(); initializeexithandler(); -- 2.34.1