HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Runtime.Heap.Layout

  • 10 types
  • 48 values
  • Packageghc-9.10.3
  • Exports58
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceLayout.hs

Words and bytes

14 declarations
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

Closure representation

6 declarations
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-9.10.3 · GHC.Runtime.Heap.Layout
  • Ord SMRepDefined in ghc-9.10.3 · GHC.Runtime.Heap.Layout
  • Outputable SMRepDefined in ghc-9.10.3 · 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

valueprofHdrSize :: Profile -> WordOff
#

Size of the profiling part of a closure header (StgProfHeader in includes/rts/storage/Closures.h)

RTS closure types

Arrays

valuecard :: Platform -> Int -> Int
#

The byte offset into the card table of the card for a given element