W3cubDocs

/Kotlin

allocArray

Platform and version requirements: Native (1.3)
fun <reified T : CVariable> NativePlacement.allocArray(
    length: Long
): CArrayPointer<T>
fun <reified T : CVariable> NativePlacement.allocArray(
    length: Int
): CArrayPointer<T>

Allocates C array of given elements type and length.

Parameters

T - must not be abstract

Platform and version requirements: Native (1.3)
inline fun <reified T : CVariable> NativePlacement.allocArray(
    length: Long, 
    initializer: T.(index: Long) -> Unit
): CArrayPointer<T>
inline fun <reified 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.

Parameters

T - must not be abstract

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/alloc-array.html