derive-storable-0.1.0.4: Derive Storable instances with GHC.Generics.

Copyright(c) Mateusz Kłoczko 2016
LicenseMIT
Maintainermateusz.p.kloczko@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Foreign.Storable.Generic.Tools

Description

 

Synopsis

Documentation

type Size = Int Source #

data Filling Source #

The datatype representing the memory layout of a given struct.

Constructors

Size Int 
Padding Int 

calcOffsets Source #

Arguments

:: [(Size, Alignment)]

List of sizes and aligments of the type's/struct's fields. [(Int,Int)]

-> [Offset]

List representing the offests of the type's/struct's fields. [Int]

Calculates the memory offset of type's/struct's fields.

calcSize Source #

Arguments

:: [(Size, Alignment)]

List of sizes and aligments of the type's/struct's fields. [(Int,Int)].

-> Size

The returned size. Int

Calculates the size of the type/struct.

calcAlignment Source #

Arguments

:: [Alignment]

List of struct's fields' alignments.

-> Alignment

The resulting alignment.

Calculate the alignment of a struct.

getFilling Source #

Arguments

:: [(Size, Alignment)]

List of sizes and aligments of the type's/struct's fields. [(Int,Int)]

-> [Filling]

List representing the memory layout. [Filling]

Get the memory layout of a given type/struct. Used mostly as debug information.