Adapter

interface Adapter<Pointer : Any>(source)

Platform abstraction to native functions to layout and structs.

Properties

Link copied to clipboard
abstract val nullPointer: Pointer

Represents a pointer to null.

Link copied to clipboard
abstract val pointerSize: Int

Size of a pointer in bytes.

Functions

Link copied to clipboard
abstract fun addressAt(pointer: Pointer, offset: Int): Pointer

Returns the address at the given offset relatively to pointer.

Link copied to clipboard
abstract fun allocate(size: Int): Struct.Memory<Pointer>

Allocates memory of the given size to hold a struct and returns a Memory to read from and write to it.

Link copied to clipboard
abstract fun reinterpret(pointer: Pointer, size: Int): Struct.Memory<Pointer>

Wraps an existing memory identified by pointer and returns a Memory to read from and write to it.