kb-text-shape
Safe HaskellNone
LanguageGHC2021

KB.Text.Shape.FFI.Allocator

Synopsis

Documentation

  typedef void kbts_allocator_function(void *Data, kbts_allocator_op *Op);
    [Data] the custom data pointer you passed in along with your allocator.
    [Op]   the memory request. It is of this type:

      :kbts_allocator_op
      :allocator_op
      typedef struct kbts_allocator_op
      {
        kbts_allocator_op_kind Kind;

        union
        {
          kbts_allocator_op_allocate Allocate;
          kbts_allocator_op_free Free;
        };
      } kbts_allocator_op;

And the possible op kinds are: KBTS_ALLOCATOR_OP_KIND_ALLOCATE KBTS_ALLOCATOR_OP_KIND_FREE

ALLOCATE expects you to fill in Op->Allocate.Pointer. The allocation does not need to be aligned. FREE expects you to free Op->Free.Pointer.

type Allocator = Ptr () -> Ptr Op -> IO () Source #

void kbts_allocator_function(void *Data, kbts_allocator_op *Op);

newtype OpKind Source #

Constructors

OpKind CInt 

Instances

Instances details
Storable OpKind Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

Show OpKind Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

Eq OpKind Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

Methods

(==) :: OpKind -> OpKind -> Bool #

(/=) :: OpKind -> OpKind -> Bool #

Ord OpKind Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

data Op Source #

Constructors

Op 

Fields

Instances

Instances details
Storable Op Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

Methods

sizeOf :: Op -> Int #

alignment :: Op -> Int #

peekElemOff :: Ptr Op -> Int -> IO Op #

pokeElemOff :: Ptr Op -> Int -> Op -> IO () #

peekByteOff :: Ptr b -> Int -> IO Op #

pokeByteOff :: Ptr b -> Int -> Op -> IO () #

peek :: Ptr Op -> IO Op #

poke :: Ptr Op -> Op -> IO () #

Show Op Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

Methods

showsPrec :: Int -> Op -> ShowS #

show :: Op -> String #

showList :: [Op] -> ShowS #

Eq Op Source # 
Instance details

Defined in KB.Text.Shape.FFI.Allocator

Methods

(==) :: Op -> Op -> Bool #

(/=) :: Op -> Op -> Bool #