ffi_bridge library

Classes

Allocator
Manages memory on the native heap.
Bool
Represents a native bool in C.
Double
Represents a native 64 bit double in C.
DynamicLibrary
Represents a dynamically loaded C library.
Finalizable
Marker interface for objects which should not be finalized too soon.
Float
Represents a native 32 bit float in C.
Int
The C int type.
Int16
Represents a native signed 16 bit integer in C.
Int32
Represents a native signed 32 bit integer in C.
Int64
Represents a native signed 64 bit integer in C.
Int8
Represents a native signed 8 bit integer in C.
IntPtr
Represents a native pointer-sized integer in C.
NativeFunction<T extends Function>
Represents a function type in C.
NativeType
NativeType's subtypes represent a native type in C.
Opaque
Opaque's subtypes represent opaque types in C.
Pointer<T extends NativeType>
Represents a pointer into the native C memory. Cannot be extended.
Size
Represents a Size type in C.
Uint16
Represents a native unsigned 16 bit integer in C.
Uint32
Represents a native unsigned 32 bit integer in C.
Uint64
Represents a native unsigned 64 bit integer in C.
Uint8
Represents a native unsigned 8 bit integer in C.
UintPtr
Represents a native pointer-sized unsigned integer in C.
UnsignedInt
The C unsigned int type.
Void
Represents a void type in C.
WebModuleLoader

Enums

GlobalMemory
Used on DynamicLibrary creation to control if the therby newly created Memory object should be registered as Memory.global.
WasmType
Enum for StandaloneWasmModule and EmscriptenModule

Mixins

ModuleLoader
An interface for loading module binary.

Extensions

AllocatorAlloc on Allocator
Extension on Allocator to provide allocation with NativeType.
DoublePointer on Pointer<Double>
Extension on Pointer specialized for the type argument Double.
FloatPointer on Pointer<Float>
Extension on Pointer specialized for the type argument Float.
Int16Pointer on Pointer<Int16>
Extension on Pointer specialized for the type argument Int16.
Int32Pointer on Pointer<Int32>
Extension on Pointer specialized for the type argument Int32.
Int64Pointer on Pointer<Int64>
Extension on Pointer specialized for the type argument Int64.
Int8Pointer on Pointer<Int8>
Extension on Pointer specialized for the type argument Int8.
IntPtrPointer on Pointer<IntPtr>
Extension on Pointer specialized for the type argument IntPtr.
ListExtension on List<T>
NativeFunctionPointer on Pointer<NativeFunction<NF>>
Extension on Pointer specialized for the type argument NativeFunction.
PointerPointer on Pointer<Pointer<T>>
Extension on Pointer specialized for the type argument Pointer.
Uint16Pointer on Pointer<Uint16>
Extension on Pointer specialized for the type argument Uint16.
Uint32Pointer on Pointer<Uint32>
Extension on Pointer specialized for the type argument Uint32.
Uint64Pointer on Pointer<Uint64>
Extension on Pointer specialized for the type argument Uint64.
Uint8Pointer on Pointer<Uint8>
Extension on Pointer specialized for the type argument Uint8.

Properties

callbackHelpers List<Function Function(Function)>
final
exportedFunctions Map<Function, Pointer<NativeType>>
final
nullptr Pointer<Never>
Represents a pointer into the native C memory corresponding to "NULL", e.g. a pointer with address 0.
final
signatures Map<String, String>
final

Functions

initSignatures([int pointerSizeBytes = 4]) → void
initTypes([int pointerSizeBytes = 4]) → void
Must be called before working with wasm_ffi to initalize all type sizes.
pointerFromFunctionImpl<T extends Function>(Function func, WasmTable table, Memory memory) Pointer<NativeFunction<T>>
registerOpaqueType<T extends Opaque>([int? size]) → void
Must be called with each type that extends Opaque before attemtping to use that type.
sizeOf<T extends NativeType>() int
Number of bytes used by native type T.

Typedefs

AllowedFunc = JSAny Function(JSAny?, JSAny?, JSAny?, JSAny?)
Char = Int8
Miscellaneous types, defined as alias
Long = Int32
LongLong = Int64
NativeFinalizerFunction = NativeFunction<Void Function(Pointer<Void> token)>
The native function type for NativeFinalizers.
Short = Int16
UnsignedChar = Uint8
UnsignedLong = Uint32
UnsignedLongLong = Uint64
UnsignedShort = Uint16
WChar = Int32