SMRep(..), ClosureType(..),
isStaticRep,
fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize,
- profHdrSize,
+ profHdrSize, thunkHdrSize,
tablesNextToCode,
smRepClosureType, smRepClosureTypeInt,
import TyCon ( TyCon, tyConPrimRep )
import MachOp-- ( MachRep(..), MachHint(..), wordRep )
import StaticFlags ( opt_SccProfilingOn, opt_GranMacros,
- opt_Unregisterised )
+ opt_Unregisterised, opt_SMP )
import Constants
import Outputable
arrPtrsHdrSize :: ByteOff
arrPtrsHdrSize = fixedHdrSize*wORD_SIZE + sIZEOF_StgMutArrPtrs_NoHdr
+
+-- Thunks have an extra header word on SMP, so the update doesn't
+-- splat the payload.
+thunkHdrSize :: WordOff
+thunkHdrSize | opt_SMP = fixedHdrSize + smp_hdr
+ | otherwise = fixedHdrSize
+ where smp_hdr = sIZEOF_StgSMPThunkHeader `quot` wORD_SIZE
\end{code}
\begin{code}