ddc-core-salt-0.4.1.3: Disciplined Disciple Compiler C code generator.

Safe HaskellNone

DDC.Core.Lite.Layout

Contents

Description

Layout of algebraic data.

Synopsis

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.

Instances

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.