remove empty dir
[ghc-hetmet.git] / ghc / compiler / codeGen / SMRep.lhs
index 1ffbcda..c807703 100644 (file)
@@ -28,7 +28,7 @@ module SMRep (
        SMRep(..), ClosureType(..),
        isStaticRep,
        fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize,
-       profHdrSize,
+       profHdrSize, thunkHdrSize,
        tablesNextToCode,
        smRepClosureType, smRepClosureTypeInt,
 
@@ -251,8 +251,8 @@ data SMRep
   = GenericRep         -- GC routines consult sizes in info tbl
        Bool            -- True <=> This is a static closure.  Affects how 
                        --          we garbage-collect it
-       !Int            -- # ptr words
-       !Int            -- # non-ptr words
+       !Int            --  # ptr words
+       !Int            --  # non-ptr words
        ClosureType     -- closure type
 
   | BlackHoleRep
@@ -285,6 +285,12 @@ arrWordsHdrSize   = fixedHdrSize*wORD_SIZE + sIZEOF_StgArrWords_NoHdr
 
 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 = fixedHdrSize + smp_hdr
+       where smp_hdr = sIZEOF_StgSMPThunkHeader `quot` wORD_SIZE
 \end{code}
 
 \begin{code}