Package kotlin.native
Types
BitSet
A vector of bits growing if necessary and allowing one to set/clear/read bits from it by a bit index.
class BitSet
CpuArchitecture
Central Processor Unit architecture.
enum class CpuArchitecture
ImmutableBlob
An immutable compile-time array of bytes.
class ImmutableBlob
IncorrectDereferenceException
Exception thrown when top level variable is accessed from incorrect execution context.
class IncorrectDereferenceException : RuntimeException
MemoryModel
Memory model.
enum class MemoryModel
OsFamily
Operating system family.
enum class OsFamily
Platform
Object describing the current platform program executes upon.
object Platform
ReportUnhandledExceptionHook
Typealias describing custom exception reporting hook.
typealias ReportUnhandledExceptionHook = (Throwable) -> Unit
Vector128
class Vector128
Annotations
CName
Makes top level function available from C/C++ code with the given name.
annotation class CName
Retain
Preserve the function entry point during global optimizations.
annotation class Retain
RetainForTarget
Preserve the function entry point during global optimizations, only for the given target.
annotation class RetainForTarget
SymbolName
Forces the compiler to use specified symbol name for the target external
function.
annotation class SymbolName
Functions
asCPointer
Returns stable C pointer to data at certain offset, useful as a way to pass resource to C APIs.
fun ImmutableBlob.asCPointer( offset: Int = 0 ): CPointer<ByteVar>
asUCPointer
fun ImmutableBlob.asUCPointer( offset: Int = 0 ): CPointer<UByteVar>
deinitRuntimeIfNeeded
Deinitializes Kotlin runtime for the current thread, if was inited. Cannot be called from Kotlin frames holding references, thus deprecated.
fun deinitRuntimeIfNeeded()
getCharAt
getDoubleAt
getFloatAt
getIntAt
getLongAt
getShortAt
getStackTraceAddresses
Returns a list of stack trace addresses representing the stack trace pertaining to this throwable.
fun Throwable.getStackTraceAddresses(): List<Long>
getUByteAt
getUIntAt
getULongAt
getUShortAt
identityHashCode
Compute stable wrt potential object relocations by the memory manager identity hash code.
fun Any?.identityHashCode(): Int
immutableBlobOf
Creates ImmutableBlob out of compile-time constant data.
fun immutableBlobOf(vararg elements: Short): ImmutableBlob
initRuntimeIfNeeded
Initializes Kotlin runtime for the current thread, if not inited already.
fun initRuntimeIfNeeded()
setCharAt
setDoubleAt
setFloatAt
setIntAt
setLongAt
setShortAt
setUByteAt
setUIntAt
setULongAt
setUnhandledExceptionHook
Install custom unhandled exception hook. Returns old hook, or null if it was not specified. Hook is invoked whenever there's uncaught exception reaching boundaries of the Kotlin world, i.e. top level main(), or when Objective-C to Kotlin call not marked with @Throws throws an exception. Hook must be a frozen lambda, so that it could be called from any thread/worker. Hook is invoked once, and is cleared afterwards, so that memory leak detection works as expected even with custom exception hooks.
fun setUnhandledExceptionHook( hook: ReportUnhandledExceptionHook ): ReportUnhandledExceptionHook?
setUShortAt
stringFromUtf8
Converts an UTF-8 array into a String. Replaces invalid input sequences with a default character.
fun ByteArray.stringFromUtf8(): String
fun ByteArray.stringFromUtf8( start: Int = 0, size: Int = this.size ): String
stringFromUtf8OrThrow
Converts an UTF-8 array into a String.
fun ByteArray.stringFromUtf8OrThrow(): String
fun ByteArray.stringFromUtf8OrThrow( start: Int = 0, size: Int = this.size ): String
toByteArray
Copies the data from this blob into a new ByteArray.
fun ImmutableBlob.toByteArray( startIndex: Int = 0, endIndex: Int = size ): ByteArray
toUByteArray
Copies the data from this blob into a new UByteArray.
fun ImmutableBlob.toUByteArray( startIndex: Int = 0, endIndex: Int = size ): UByteArray
toUtf8
Converts a String into an UTF-8 array. Replaces invalid input sequences with a default character.
fun String.toUtf8(): ByteArray
fun String.toUtf8( start: Int = 0, size: Int = this.length ): ByteArray
toUtf8OrThrow
Converts a String into an UTF-8 array.
fun String.toUtf8OrThrow(): ByteArray
fun String.toUtf8OrThrow( start: Int = 0, size: Int = this.length ): ByteArray
vectorOf
fun vectorOf( f0: Float, f1: Float, f2: Float, f3: Float ): Vector128
fun vectorOf(f0: Int, f1: Int, f2: Int, f3: Int): Vector128
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/index.html