NativePlacement

interface NativePlacement

Functions

alloc
Link copied to clipboard
open fun alloc(size: Int, align: Int): NativePointed
abstract fun alloc(size: Long, align: Int): NativePointed

Inheritors

NativeFreeablePlacement
Link copied to clipboard
AutofreeScope
Link copied to clipboard

Extensions

alloc
Link copied to clipboard
inline fun <T : CVariable> NativePlacement.alloc(): T

Allocates variable of given type.

inline fun <T : CVariable> NativePlacement.alloc(initialize: T.() -> Unit): T

Allocates variable of given type and initializes it applying given block.

allocArray
Link copied to clipboard
inline fun <T : CVariable> NativePlacement.allocArray(length: Long): CArrayPointer<T>
inline fun <T : CVariable> NativePlacement.allocArray(length: Int): CArrayPointer<T>

Allocates C array of given elements type and length.

inline fun <T : CVariable> NativePlacement.allocArray(length: Long, initializer: T.(index: Long) -> Unit): CArrayPointer<T>
inline fun <T : CVariable> NativePlacement.allocArray(length: Int, initializer: T.(index: Int) -> Unit): CArrayPointer<T>

Allocates C array of given elements type and length, and initializes its elements applying given block.

allocArrayOf
Link copied to clipboard
inline fun <T : CPointer<*>> NativePlacement.allocArrayOf(vararg elements: T?): CArrayPointer<CPointerVarOf<T>>
inline fun <T : CPointer<*>> NativePlacement.allocArrayOf(elements: List<T?>): CArrayPointer<CPointerVarOf<T>>

Allocates C array of given values.

fun NativePlacement.allocArrayOf(elements: ByteArray): CArrayPointer<ByteVar>
fun NativePlacement.allocArrayOf(vararg elements: Float): CArrayPointer<FloatVar>
allocArrayOfPointersTo
Link copied to clipboard
fun <T : CPointed> NativePlacement.allocArrayOfPointersTo(elements: List<T?>): CArrayPointer<CPointerVar<T>>
fun <T : CPointed> NativePlacement.allocArrayOfPointersTo(vararg elements: T?): CPointer<CPointerVarOf<CPointer<T>>>

Allocates C array of pointers to given elements.

allocPointerTo
Link copied to clipboard
fun <T : CPointed> NativePlacement.allocPointerTo(): CPointerVarOf<CPointer<T>>