X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FClosures.h;h=3df208cd09f2f25ee90df5605ae14f010f9818a8;hb=c137ecd7e6e83d0f9c39b15ccdb9f2355f243c91;hp=8487893b330ad687a273a3151e1d46fc4eb3687e;hpb=d3d69395401d3e7be7a8794e0b6850e608a30a24;p=ghc-hetmet.git diff --git a/ghc/includes/Closures.h b/ghc/includes/Closures.h index 8487893..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;