Moduleghc-heap-9.10.3Haskell2010
GHC.Exts.Heap
With this module, you can investigate the heap representation of Haskell values, i.e. to investigate sharing and lazy evaluation.
- 16 types
- 1 class
- 9 values
- Packageghc-heap-9.10.3
- Exports26
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceHeap.hs
Closure types
10 declarationsThis is the representation of a Haskell value on the heap. It reflects https://gitlab.haskell.org/ghc/ghc/blob/master/rts/include/rts/storage/Closures.h
The data type is parametrized by b: the type to store references in.
Usually this is a Box with the type synonym Closure.
All Heap objects have the same basic layout. A header containing a pointer to
the info table and a payload with various fields. The info field below
always refers to the info table pointed to by the header. The remaining
fields are the payload.
See https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/heap-objects for more information.
Constructors
ConstrClosureA data constructor
FunClosureA function
info :: !StgInfoTableptrArgs :: ![b]Pointer arguments
dataArgs :: ![Word]Non-pointer arguments
ThunkClosureA thunk, an expression not obviously in head normal form
info :: !StgInfoTableptrArgs :: ![b]Pointer arguments
dataArgs :: ![Word]Non-pointer arguments
SelectorClosureA thunk which performs a simple selection operation
info :: !StgInfoTableselectee :: !bPointer to the object being selected from
PAPClosureAn unsaturated function application
info :: !StgInfoTablearity :: !HalfWordArity of the partial application
n_args :: !HalfWordSize of the payload in words
fun :: !bPointer to a FunClosure
payload :: ![b]Sequence of already applied arguments
APClosureA function application
info :: !StgInfoTablearity :: !HalfWordArity of the partial application
n_args :: !HalfWordSize of the payload in words
fun :: !bPointer to a FunClosure
payload :: ![b]Sequence of already applied arguments
APStackClosureA suspended thunk evaluation
info :: !StgInfoTablefun :: !bPointer to a FunClosure
payload :: ![b]Sequence of already applied arguments
IndClosureA pointer to another closure, introduced when a thunk is updated to point at its value
info :: !StgInfoTableindirectee :: !bTarget closure
BCOClosureA byte-code object (BCO) which can be interpreted by GHC's byte-code interpreter (e.g. as used by GHCi)
info :: !StgInfoTableinstrs :: !bA pointer to an ArrWords of instructions
literals :: !bA pointer to an ArrWords of literals
bcoptrs :: !bA pointer to an ArrWords of byte code objects
arity :: !HalfWordArity of the partial application
size :: !HalfWordThe size of this BCO in words
bitmap :: ![Word]An StgLargeBitmap describing the pointerhood of its args/free vars
BlackholeClosureA thunk under evaluation by another thread
info :: !StgInfoTableindirectee :: !bTarget closure
ArrWordsClosureA
ByteArray#MutArrClosureA
MutableByteArray#info :: !StgInfoTablemccPtrs :: !WordNumber of pointers
mccSize :: !Word?? Closures.h vs ClosureMacros.h
mccPayload :: ![b]Array payload Card table ignored
SmallMutArrClosureA
SmallMutableArray#info :: !StgInfoTablemccPtrs :: !WordNumber of pointers
mccPayload :: ![b]Array payload Card table ignored
MVarClosureAn
MVar#, with a queue of thread state objects blocking on theminfo :: !StgInfoTablequeueHead :: !bPointer to head of queue
queueTail :: !bPointer to tail of queue
value :: !bPointer to closure
IOPortClosureAn
IOPort#, with a queue of thread state objects blocking on theminfo :: !StgInfoTablequeueHead :: !bPointer to head of queue
queueTail :: !bPointer to tail of queue
value :: !bPointer to closure
MutVarClosureA
MutVar#info :: !StgInfoTablevar :: !bPointer to contents
BlockingQueueClosureAn STM blocking queue.
WeakClosureinfo :: !StgInfoTablecfinalizers :: !bkey :: !bvalue :: !bPointer to closure
finalizer :: !bweakLink :: !Maybe bnext weak pointer for the capability
TSOClosureRepresentation of StgTSO: A Thread State Object. The values for what_next, why_blocked and flags are defined in
Constants.h.info :: !StgInfoTablelink :: !b?? Here so it looks like an IND
global_link :: !btsoStack :: !bstackobj from StgTSO
trec :: !bblocked_exceptions :: !bbq :: !bthread_label :: !Maybe bwhat_next :: !WhatNextwhy_blocked :: !WhyBlockedflags :: ![TsoFlags]threadId :: !Word64saved_errno :: !Word32tso_dirty :: !Word32non-zero => dirty
alloc_limit :: !Int64tot_stack_size :: !Word32prof :: !Maybe StgTSOProfInfo
StackClosureRepresentation of StgStack: The 'tsoStack ' of a TSOClosure.
info :: !StgInfoTablestack_size :: !Word32stack size in *words*
stack_dirty :: !Word8non-zero => dirty
stack_marking :: !Word8
IntClosurePrimitive Int
WordClosurePrimitive Word
Int64ClosurePrimitive Int64
Word64ClosurePrimitive Word64
AddrClosurePrimitive Addr
FloatClosurePrimitive Float
DoubleClosurePrimitive Double
OtherClosureAnother kind of closure
info :: !StgInfoTablehvalues :: ![b]rawWords :: ![Word]
UnsupportedClosureinfo :: !StgInfoTable
UnknownTypeWordSizedPrimitiveA primitive word from a bitmap encoded stack frame payload
The type itself cannot be restored (i.e. it might represent a Word8# or an Int#).
Instances6Functor, Foldable, Traversable, Show, Generic, Rep
Functor GenClosureDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresFoldable GenClosureDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresTraversable GenClosureDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresShow b => Show (GenClosure b)Defined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresGeneric (GenClosure b)Defined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closurestype Rep (GenClosure b) = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closures"GenClosure"
"GHC.Exts.Heap.Closures"
"ghc-heap-9.10.3-95d6"
'False) ((((C1 ('MetaCons"ConstrClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"ptrArgs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b]) :*: S1 ('MetaSel ('Just"dataArgs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word]))) :*: (S1 ('MetaSel ('Just"pkg"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Just"modl"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just"name"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))) :+: (C1 ('MetaCons"FunClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"ptrArgs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b]) :*: S1 ('MetaSel ('Just"dataArgs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word]))) :+: C1 ('MetaCons"ThunkClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"ptrArgs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b]) :*: S1 ('MetaSel ('Just"dataArgs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word]))))) :+: ((C1 ('MetaCons"SelectorClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"selectee"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :+: C1 ('MetaCons"PAPClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"arity"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 HalfWord)) :*: (S1 ('MetaSel ('Just"n_args"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 HalfWord) :*: (S1 ('MetaSel ('Just"fun"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"payload"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b]))))) :+: (C1 ('MetaCons"APClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"arity"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 HalfWord)) :*: (S1 ('MetaSel ('Just"n_args"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 HalfWord) :*: (S1 ('MetaSel ('Just"fun"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"payload"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b])))) :+: C1 ('MetaCons"APStackClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"fun"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"payload"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b])))))) :+: (((C1 ('MetaCons"IndClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"indirectee"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :+: C1 ('MetaCons"BCOClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"instrs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"literals"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))) :*: ((S1 ('MetaSel ('Just"bcoptrs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"arity"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 HalfWord)) :*: (S1 ('MetaSel ('Just"size"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 HalfWord) :*: S1 ('MetaSel ('Just"bitmap"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word]))))) :+: (C1 ('MetaCons"BlackholeClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"indirectee"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :+: C1 ('MetaCons"ArrWordsClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"bytes"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word) :*: S1 ('MetaSel ('Just"arrWords"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word]))))) :+: ((C1 ('MetaCons"MutArrClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"mccPtrs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word)) :*: (S1 ('MetaSel ('Just"mccSize"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word) :*: S1 ('MetaSel ('Just"mccPayload"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b]))) :+: C1 ('MetaCons"SmallMutArrClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"mccPtrs"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word) :*: S1 ('MetaSel ('Just"mccPayload"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b])))) :+: (C1 ('MetaCons"MVarClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"queueHead"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :*: (S1 ('MetaSel ('Just"queueTail"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"value"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))) :+: C1 ('MetaCons"IOPortClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"queueHead"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :*: (S1 ('MetaSel ('Just"queueTail"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"value"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))))))) :+: (((C1 ('MetaCons"MutVarClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"var"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :+: (C1 ('MetaCons"BlockingQueueClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"link"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :*: (S1 ('MetaSel ('Just"blackHole"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: (S1 ('MetaSel ('Just"owner"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"queue"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)))) :+: C1 ('MetaCons"WeakClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"cfinalizers"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"key"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))) :*: (S1 ('MetaSel ('Just"value"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: (S1 ('MetaSel ('Just"finalizer"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"weakLink"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe b))))))) :+: ((C1 ('MetaCons"TSOClosure"
'PrefixI 'True) ((((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"link"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :*: (S1 ('MetaSel ('Just"global_link"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"tsoStack"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))) :*: ((S1 ('MetaSel ('Just"trec"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"blocked_exceptions"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)) :*: (S1 ('MetaSel ('Just"bq"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just"thread_label"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe b))))) :*: (((S1 ('MetaSel ('Just"what_next"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 WhatNext) :*: S1 ('MetaSel ('Just"why_blocked"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 WhyBlocked)) :*: (S1 ('MetaSel ('Just"flags"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [TsoFlags]) :*: S1 ('MetaSel ('Just"threadId"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just"saved_errno"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32) :*: S1 ('MetaSel ('Just"tso_dirty"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just"alloc_limit"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int64) :*: (S1 ('MetaSel ('Just"tot_stack_size"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32) :*: S1 ('MetaSel ('Just"prof"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe StgTSOProfInfo))))))) :+: C1 ('MetaCons"StackClosure"
'PrefixI 'True) ((S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: S1 ('MetaSel ('Just"stack_size"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just"stack_dirty"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8) :*: S1 ('MetaSel ('Just"stack_marking"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8)))) :+: (C1 ('MetaCons"IntClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"intVal"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int)) :+: C1 ('MetaCons"WordClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"wordVal"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word))))) :+: (((C1 ('MetaCons"Int64Closure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"int64Val"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int64)) :+: C1 ('MetaCons"Word64Closure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"word64Val"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :+: (C1 ('MetaCons"AddrClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"addrVal"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (Ptr ()))) :+: C1 ('MetaCons"FloatClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"floatVal"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Float)))) :+: ((C1 ('MetaCons"DoubleClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"ptipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrimType) :*: S1 ('MetaSel ('Just"doubleVal"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Double)) :+: C1 ('MetaCons"OtherClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable) :*: (S1 ('MetaSel ('Just"hvalues"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [b]) :*: S1 ('MetaSel ('Just"rawWords"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word])))) :+: (C1 ('MetaCons"UnsupportedClosure"
'PrefixI 'True) (S1 ('MetaSel ('Just"info"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StgInfoTable)) :+: C1 ('MetaCons"UnknownTypeWordSizedPrimitive"
'PrefixI 'True) (S1 ('MetaSel ('Just"wordVal"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word)))))))
Enum representing closure types
This is a mirror of:
rtsincludertsstorageClosureTypes.h
Instances6Enum, Eq, Ord, Show, Generic, Rep
Enum ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesEq ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesOrd ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesShow ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesGeneric ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypestype Rep ClosureType = D1 ('MetaDataDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes"ClosureType"
"GHC.Internal.ClosureTypes"
"ghc-internal"
'False) ((((((C1 ('MetaCons"INVALID_OBJECT"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CONSTR"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"CONSTR_1_0"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CONSTR_0_1"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"CONSTR_2_0"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CONSTR_1_1"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"CONSTR_0_2"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CONSTR_NOCAF"
'PrefixI 'False) U1))) :+: (((C1 ('MetaCons"FUN"
'PrefixI 'False) U1 :+: C1 ('MetaCons"FUN_1_0"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"FUN_0_1"
'PrefixI 'False) U1 :+: C1 ('MetaCons"FUN_2_0"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"FUN_1_1"
'PrefixI 'False) U1 :+: C1 ('MetaCons"FUN_0_2"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"FUN_STATIC"
'PrefixI 'False) U1 :+: C1 ('MetaCons"THUNK"
'PrefixI 'False) U1)))) :+: ((((C1 ('MetaCons"THUNK_1_0"
'PrefixI 'False) U1 :+: C1 ('MetaCons"THUNK_0_1"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"THUNK_2_0"
'PrefixI 'False) U1 :+: C1 ('MetaCons"THUNK_1_1"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"THUNK_0_2"
'PrefixI 'False) U1 :+: C1 ('MetaCons"THUNK_STATIC"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"THUNK_SELECTOR"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BCO"
'PrefixI 'False) U1))) :+: (((C1 ('MetaCons"AP"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PAP"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"AP_STACK"
'PrefixI 'False) U1 :+: C1 ('MetaCons"IND"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"IND_STATIC"
'PrefixI 'False) U1 :+: C1 ('MetaCons"RET_BCO"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"RET_SMALL"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"RET_BIG"
'PrefixI 'False) U1 :+: C1 ('MetaCons"RET_FUN"
'PrefixI 'False) U1)))))) :+: (((((C1 ('MetaCons"UPDATE_FRAME"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CATCH_FRAME"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"UNDERFLOW_FRAME"
'PrefixI 'False) U1 :+: C1 ('MetaCons"STOP_FRAME"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"BLOCKING_QUEUE"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BLACKHOLE"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MVAR_CLEAN"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MVAR_DIRTY"
'PrefixI 'False) U1))) :+: (((C1 ('MetaCons"TVAR"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ARR_WORDS"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MUT_ARR_PTRS_CLEAN"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MUT_ARR_PTRS_DIRTY"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"MUT_ARR_PTRS_FROZEN_DIRTY"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MUT_ARR_PTRS_FROZEN_CLEAN"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MUT_VAR_CLEAN"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MUT_VAR_DIRTY"
'PrefixI 'False) U1)))) :+: ((((C1 ('MetaCons"WEAK"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PRIM"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"MUT_PRIM"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TSO"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"STACK"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TREC_CHUNK"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ATOMICALLY_FRAME"
'PrefixI 'False) U1 :+: C1 ('MetaCons"CATCH_RETRY_FRAME"
'PrefixI 'False) U1))) :+: (((C1 ('MetaCons"CATCH_STM_FRAME"
'PrefixI 'False) U1 :+: C1 ('MetaCons"WHITEHOLE"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"SMALL_MUT_ARR_PTRS_CLEAN"
'PrefixI 'False) U1 :+: C1 ('MetaCons"SMALL_MUT_ARR_PTRS_DIRTY"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"SMALL_MUT_ARR_PTRS_FROZEN_DIRTY"
'PrefixI 'False) U1 :+: C1 ('MetaCons"SMALL_MUT_ARR_PTRS_FROZEN_CLEAN"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"COMPACT_NFDATA"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"CONTINUATION"
'PrefixI 'False) U1 :+: C1 ('MetaCons"N_CLOSURE_TYPES"
'PrefixI 'False) U1)))))))
Instances5Eq, Ord, Show, Generic, Rep
Eq PrimTypeDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresOrd PrimTypeDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresShow PrimTypeDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresGeneric PrimTypeDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closurestype Rep PrimType = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closures"PrimType"
"GHC.Exts.Heap.Closures"
"ghc-heap-9.10.3-95d6"
'False) ((C1 ('MetaCons"PInt"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"PWord"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PInt64"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"PWord64"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PAddr"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"PFloat"
'PrefixI 'False) U1 :+: C1 ('MetaCons"PDouble"
'PrefixI 'False) U1)))
Constructors
ThreadRunGHCThreadInterpretThreadKilledThreadCompleteWhatNextUnknownValue Word16Please report this as a bug
Instances5Eq, Ord, Show, Generic, Rep
Eq WhatNextDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresOrd WhatNextDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresShow WhatNextDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresGeneric WhatNextDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closurestype Rep WhatNext = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closures"WhatNext"
"GHC.Exts.Heap.Closures"
"ghc-heap-9.10.3-95d6"
'False) ((C1 ('MetaCons"ThreadRunGHC"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ThreadInterpret"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ThreadKilled"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"ThreadComplete"
'PrefixI 'False) U1 :+: C1 ('MetaCons"WhatNextUnknownValue"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))))
Instances5Eq, Ord, Show, Generic, Rep
Eq WhyBlockedDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresOrd WhyBlockedDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresShow WhyBlockedDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresGeneric WhyBlockedDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closurestype Rep WhyBlocked = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closures"WhyBlocked"
"GHC.Exts.Heap.Closures"
"ghc-heap-9.10.3-95d6"
'False) (((C1 ('MetaCons"NotBlocked"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"BlockedOnMVar"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BlockedOnMVarRead"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"BlockedOnBlackHole"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BlockedOnRead"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"BlockedOnWrite"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BlockedOnDelay"
'PrefixI 'False) U1))) :+: ((C1 ('MetaCons"BlockedOnSTM"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"BlockedOnDoProc"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BlockedOnCCall"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"BlockedOnCCall_Interruptible"
'PrefixI 'False) U1 :+: C1 ('MetaCons"BlockedOnMsgThrowTo"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"ThreadMigrating"
'PrefixI 'False) U1 :+: C1 ('MetaCons"WhyBlockedUnknownValue"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16))))))
Constructors
Instances5Eq, Ord, Show, Generic, Rep
Eq TsoFlagsDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresOrd TsoFlagsDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresShow TsoFlagsDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ClosuresGeneric TsoFlagsDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closurestype Rep TsoFlags = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.Closures"TsoFlags"
"GHC.Exts.Heap.Closures"
"ghc-heap-9.10.3-95d6"
'False) (((C1 ('MetaCons"TsoLocked"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TsoBlockx"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"TsoInterruptible"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TsoStoppedOnBreakpoint"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"TsoMarked"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TsoSqueezed"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"TsoAllocLimit"
'PrefixI 'False) U1 :+: C1 ('MetaCons"TsoFlagsUnknownValue"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))))
Methods
getClosureData :: a -> IO ClosureDecode a closure to it's heap representation (GenClosure).
Instances9HasHeapRep, …
HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapHasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapAddr# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapDouble# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapFloat# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapInt# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapInt64# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapWord# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.HeapWord64# ~ a => HasHeapRep aDefined in ghc-heap-9.10.3 · GHC.Exts.Heap
Convert an unpacked heap object, to a `GenClosure b`. The inputs to this function can be generated from a heap object using unpackClosure#.
getClosureDataFromHeapRepPrim :: IO (String, String, String)A continuation used to decode the constructor description field, in ghc-debug this code can lead to segfaults because dataConNames will dereference a random part of memory.
-> (Ptr a -> IO (Maybe CostCentreStack))A continuation which is used to decode a cost centre stack In ghc-debug, this code will need to call back into the debuggee to fetch the representation of the CCS before decoding it. Using
peekTopCCSfor this argument can lead to segfaults in ghc-debug as the CCS argument will point outside the copied closure.-> StgInfoTableThe StgInfoTable of the closure, extracted from the heap representation.
-> ByteArray#Heap representation of the closure as returned by unpackClosure#. This includes all of the object including the header, info table pointer, pointer data, and non-pointer data. The ByteArray# may be pinned or unpinned.
-> [b]Pointers in the payload of the closure, extracted from the heap representation as returned by `collect_pointers()` in
Heap.c. The typebis some representation of a pointer e.g. Any or `Ptr Any`.-> IO (GenClosure b)Heap representation of the closure.
Info Table types
7 declarationsThis is a somewhat faithful representation of an info table. See https://gitlab.haskell.org/ghc/ghc/blob/master/rts/include/rts/storage/InfoTables.h for more details on this data structure.
Constructors
Instances4Eq, Show, Generic, Rep
Eq StgInfoTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.InfoTable.TypesShow StgInfoTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.InfoTable.TypesGeneric StgInfoTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.InfoTable.Typestype Rep StgInfoTable = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.InfoTable.Types"StgInfoTable"
"GHC.Exts.Heap.InfoTable.Types"
"ghc-heap-9.10.3-95d6"
'False) (C1 ('MetaCons"StgInfoTable"
'PrefixI 'True) ((S1 ('MetaSel ('Just"entry"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EntryFunPtr)) :*: (S1 ('MetaSel ('Just"ptrs"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HalfWord) :*: S1 ('MetaSel ('Just"nptrs"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HalfWord))) :*: (S1 ('MetaSel ('Just"tipe"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClosureType) :*: (S1 ('MetaSel ('Just"srtlen"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HalfWord) :*: S1 ('MetaSel ('Just"code"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ItblCodes))))))
Size in bytes of a standard InfoTable
Read an InfoTable from the heap into a haskell type. WARNING: This code assumes it is passed a pointer to a "standard" info table. If tables_next_to_code is enabled, it will look 1 byte before the start for the entry field.
Cost Centre (profiling) types
4 declarationsThis is a somewhat faithful representation of StgTSOProfInfo. See https://gitlab.haskell.org/ghc/ghc/blob/master/rts/include/rts/storage/TSO.h for more details on this data structure.
Constructors
Instances5Eq, Ord, Show, Generic, Rep
Eq StgTSOProfInfoDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesOrd StgTSOProfInfoDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesShow StgTSOProfInfoDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesGeneric StgTSOProfInfoDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Typestype Rep StgTSOProfInfo = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Types"StgTSOProfInfo"
"GHC.Exts.Heap.ProfInfo.Types"
"ghc-heap-9.10.3-95d6"
'True) (C1 ('MetaCons"StgTSOProfInfo"
'PrefixI 'True) (S1 ('MetaSel ('Just"cccs"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CostCentreStack))))
This is a somewhat faithful representation of IndexTable. See https://gitlab.haskell.org/ghc/ghc/blob/master/rts/include/rts/prof/CCS.h for more details on this data structure.
Constructors
Instances5Eq, Ord, Show, Generic, Rep
Eq IndexTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesOrd IndexTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesShow IndexTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesGeneric IndexTableDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Typestype Rep IndexTable = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Types"IndexTable"
"GHC.Exts.Heap.ProfInfo.Types"
"ghc-heap-9.10.3-95d6"
'False) (C1 ('MetaCons"IndexTable"
'PrefixI 'True) ((S1 ('MetaSel ('Just"it_cc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CostCentre) :*: S1 ('MetaSel ('Just"it_ccs"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CostCentreStack))) :*: (S1 ('MetaSel ('Just"it_next"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe IndexTable)) :*: S1 ('MetaSel ('Just"it_back_edge"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))
This is a somewhat faithful representation of CostCentre. See https://gitlab.haskell.org/ghc/ghc/blob/master/rts/include/rts/prof/CCS.h for more details on this data structure.
Constructors
Instances5Eq, Ord, Show, Generic, Rep
Eq CostCentreDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesOrd CostCentreDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesShow CostCentreDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesGeneric CostCentreDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Typestype Rep CostCentre = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Types"CostCentre"
"GHC.Exts.Heap.ProfInfo.Types"
"ghc-heap-9.10.3-95d6"
'False) (C1 ('MetaCons"CostCentre"
'PrefixI 'True) (((S1 ('MetaSel ('Just"cc_ccID"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just"cc_label"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just"cc_module"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just"cc_srcloc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)))) :*: ((S1 ('MetaSel ('Just"cc_mem_alloc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"cc_time_ticks"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word)) :*: (S1 ('MetaSel ('Just"cc_is_caf"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just"cc_link"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CostCentre))))))
This is a somewhat faithful representation of CostCentreStack. See https://gitlab.haskell.org/ghc/ghc/blob/master/rts/include/rts/prof/CCS.h for more details on this data structure.
Constructors
CostCentreStackccs_ccsID :: Intccs_cc :: CostCentreccs_prevStack :: Maybe CostCentreStackccs_indexTable :: Maybe IndexTableccs_root :: Maybe CostCentreStackccs_depth :: Wordccs_scc_count :: Word64ccs_selected :: Wordccs_time_ticks :: Wordccs_mem_alloc :: Word64ccs_inherited_alloc :: Word64ccs_inherited_ticks :: Word
Instances5Eq, Ord, Show, Generic, Rep
Eq CostCentreStackDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesOrd CostCentreStackDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesShow CostCentreStackDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.TypesGeneric CostCentreStackDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Typestype Rep CostCentreStack = D1 ('MetaDataDefined in ghc-heap-9.10.3 · GHC.Exts.Heap.ProfInfo.Types"CostCentreStack"
"GHC.Exts.Heap.ProfInfo.Types"
"ghc-heap-9.10.3-95d6"
'False) (C1 ('MetaCons"CostCentreStack"
'PrefixI 'True) (((S1 ('MetaSel ('Just"ccs_ccsID"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just"ccs_cc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CostCentre) :*: S1 ('MetaSel ('Just"ccs_prevStack"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CostCentreStack)))) :*: (S1 ('MetaSel ('Just"ccs_indexTable"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe IndexTable)) :*: (S1 ('MetaSel ('Just"ccs_root"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CostCentreStack)) :*: S1 ('MetaSel ('Just"ccs_depth"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word)))) :*: ((S1 ('MetaSel ('Just"ccs_scc_count"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: (S1 ('MetaSel ('Just"ccs_selected"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word) :*: S1 ('MetaSel ('Just"ccs_time_ticks"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word))) :*: (S1 ('MetaSel ('Just"ccs_mem_alloc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: (S1 ('MetaSel ('Just"ccs_inherited_alloc"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"ccs_inherited_ticks"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word))))))
Closure inspection
2 declarationsLike getClosureData, but taking a Box, so it is easier to work with.
For generic code, this function returns all referenced closures.
Boxes
3 declarationsAn arbitrary Haskell value in a safe Box. The point is that even
unevaluated thunks can safely be moved around inside the Box, and when
required, e.g. in getBoxedClosureData, the function knows how far it has
to evaluate the argument.
This takes an arbitrary value and puts it into a box. Note that calls like
asBox (head list)will put the thunk "head list" into the box, not the element at the head of the list. For that, use careful case expressions:
case list of x:_ -> asBox xBoxes can be compared, but this is not pure, as different heap objects can, after garbage collection, become the same object.