Safe Haskell | None |
---|
Layout of algebraic data.
- data HeapObject
- heapObjectOfDataCtor :: Platform -> DataCtor Name -> Maybe HeapObject
- payloadSizeOfDataCtor :: Platform -> DataCtor Name -> Maybe Integer
- fieldOffsetsOfDataCtor :: Platform -> DataCtor Name -> Maybe [Integer]
Heap Objects
data HeapObject Source
Enumerates the heap object formats that can be used to store algebraic data.
The layout of these is defined in the ObjectNN.dce
file of the runtime
system, where NN
is the word size of the machine.
Eq HeapObject | |
Show HeapObject |
heapObjectOfDataCtor :: Platform -> DataCtor Name -> Maybe HeapObjectSource
Decide which heap object to use to represent a data constructor.
Fields
payloadSizeOfDataCtor :: Platform -> DataCtor Name -> Maybe IntegerSource
Get the size of the payload for this data constructor. The payload holds all the fields, but does not include header information such as the constructor tag.
This doesn't add any padding for misaligned fields.
fieldOffsetsOfDataCtor :: Platform -> DataCtor Name -> Maybe [Integer]Source
Given a constructor definition, get the offset of each field in the payload of a heap object.
We don't know the absolute offset from the beginning of the heap object, because the size of the header is only known by the runtime system.
This doesn't add any padding for misaligned fields.