X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FClosures.h;h=3df208cd09f2f25ee90df5605ae14f010f9818a8;hb=1f5e3b2472084434edf71a89c4764d1509e8e9b0;hp=e8966d0e5ca9fbd36f8109ecf360fc9beff5d50e;hpb=710d005740f6d7246cce99f6d10b4e86a6d4ae4f;p=ghc-hetmet.git diff --git a/ghc/includes/Closures.h b/ghc/includes/Closures.h index e8966d0..3df208c 100644 --- a/ghc/includes/Closures.h +++ b/ghc/includes/Closures.h @@ -36,9 +36,15 @@ typedef struct { /* ----------------------------------------------------------------------------- The SMP header - - In SMP mode, we have an extra word of padding in a thunk's header. - (Note: thunks only; other closures do not have this padding word). + + A thunk has a padding word to take the updated value. This is so + that the update doesn't overwrite the payload, so we can avoid + needing to lock the thunk during entry and update. + + Note: this doesn't apply to THUNK_STATICs, which have no payload. + + Note: we leave this padding word in all ways, rather than just SMP, + so that we don't have to recompile all our libraries for SMP. -------------------------------------------------------------------------- */ typedef struct { @@ -62,13 +68,6 @@ typedef struct { #endif } StgHeader; -/* - * In SMP mode, a thunk has a padding word to take the updated value. - * This is so that the update doesn't overwrite the payload, so we can - * avoid needing to lock the thunk during entry and update. - * - * Note: this doesn't apply to THUNK_STATICs, which have no payload. - */ typedef struct { const struct _StgInfoTable* info; #ifdef PROFILING @@ -77,11 +76,11 @@ typedef struct { #ifdef GRAN StgGranHeader gran; #endif -#ifdef SMP StgSMPThunkHeader smp; -#endif } StgThunkHeader; +#define THUNK_EXTRA_HEADER_W (sizeofW(StgThunkHeader)-sizeofW(StgHeader)) + /* ----------------------------------------------------------------------------- Closure Types @@ -357,7 +356,7 @@ typedef struct { StgHeader header; StgClosure *volatile current_value; StgTVarWaitQueue *volatile first_wait_queue_entry; -#if defined(SMP) +#if defined(THREADED_RTS) StgInt volatile num_updates; #endif } StgTVar; @@ -368,7 +367,7 @@ typedef struct { StgTVar *tvar; StgClosure *expected_value; StgClosure *new_value; -#if defined(SMP) +#if defined(THREADED_RTS) StgInt num_updates; #endif } TRecEntry; @@ -399,7 +398,6 @@ typedef struct StgTRecHeader_ { typedef struct { StgHeader header; - StgBool waiting; StgClosure *code; } StgAtomicallyFrame;