HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Words and bytes

valuewordsToBytes :: Num a => Platform -> a -> a

Convert the given number of words to a number of bytes.

This function morally has type WordOff -> ByteOff, but uses Num a to allow for overloading.

newtypenewtype StgWord
#
Instances3Eq, Bits, Outputable
  • Eq StgWordDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.Layout
  • Bits StgWordDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.Layout
  • Outputable StgWordDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.Layout

Closure representation

datadata SMRep

A description of the layout of a closure. Corresponds directly to the closure types in includes/rts/storage/ClosureTypes.h.

Instances3Eq, Ord, Outputable
  • Eq SMRepDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.Layout
  • Ord SMRepDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.Layout
  • Outputable SMRepDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.Layout
typetype IsStatic = Bool

True <=> This is a static closure. Affects how we garbage-collect it. Static closure have an extra static link field at the end. Constructors do not have a static variant; see Note [static constructors]

typetype Liveness = [Bool]

We represent liveness bitmaps as a Bitmap (whose internal representation really is a bitmap). These are pinned onto case return vectors to indicate the state of the stack for the garbage collector.

In the compiled program, liveness bitmaps that fit inside a single word (StgWord) are stored as a single word, while larger bitmaps are stored as a pointer to an array of words.

Construction

Predicates

Size-related things

RTS closure types

Arrays