NativeFreeablePlacement

Since Kotlin

1.3

Inheritors

Functions

Link copied to clipboard
open fun alloc(size: Int, align: Int): NativePointed
abstract fun alloc(size: Long, align: Int): NativePointed
Since Kotlin 1.3
Link copied to clipboard
inline fun <T : CVariable> NativePlacement.alloc(): T

Allocates variable of given type.

Since Kotlin 1.3
fun <T : Byte> NativePlacement.alloc(value: T): ByteVarOf<T>
fun <T : Int> NativePlacement.alloc(value: T): IntVarOf<T>
fun <T : Long> NativePlacement.alloc(value: T): LongVarOf<T>
fun <T : UInt> NativePlacement.alloc(value: T): UIntVarOf<T>

Allocates variable with given value type and initializes it with given value.

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

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

Since Kotlin 1.3
Link copied to clipboard

Allocates C array of given elements type and length.

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

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

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

Allocates C array of given values.

Since Kotlin 1.3
Since Kotlin 1.3
Link copied to clipboard

Allocates C array of pointers to given elements.

Since Kotlin 1.3
Link copied to clipboard
Link copied to clipboard
abstract fun free(mem: NativePtr)
Since Kotlin 1.3
Link copied to clipboard
Since Kotlin 1.3