Package kotlin.native

Types

Native
1.3

BitSet

A vector of bits growing if necessary and allowing one to set/clear/read bits from it by a bit index.

class BitSet
Native
1.3

CpuArchitecture

Central Processor Unit architecture.

enum class CpuArchitecture
Native
1.3

ImmutableBlob

An immutable compile-time array of bytes.

class ImmutableBlob
Native
1.3

IncorrectDereferenceException

Exception thrown when top level variable is accessed from incorrect execution context.

class IncorrectDereferenceException : RuntimeException
Native
1.3

MemoryModel

Memory model.

enum class MemoryModel
Native
1.3

OsFamily

Operating system family.

enum class OsFamily
Native
1.3

Platform

Object describing the current platform program executes upon.

object Platform
Native
1.3

ReportUnhandledExceptionHook

Typealias describing custom exception reporting hook.

typealias ReportUnhandledExceptionHook = (Throwable) -> Unit
Native
1.3

Vector128

typealias Vector128 = Vector128

Annotations

Common
Native
1.3

CName

Makes top level function available from C/C++ code with the given name.

annotation class CName
Native
1.3

EagerInitialization

Forces a top-level property to be initialized eagerly, opposed to lazily on the first access to file and/or property. This annotation can be used as temporal migration assistance during the transition from the previous Kotlin/Native initialization scheme "eager by default" to the new one, "lazy by default".

annotation class EagerInitialization
Common
Native
1.7

FreezingIsDeprecated

Freezing API is deprecated since 1.7.20.

annotation class FreezingIsDeprecated
Common
Native
1.8

HiddenFromObjC

Instructs the Kotlin compiler to remove this class, function or property from the public Objective-C API.

annotation class HiddenFromObjC
Common
Native
1.8

HidesFromObjC

Meta-annotation that instructs the Kotlin compiler to remove the annotated class, function or property from the public Objective-C API.

annotation class HidesFromObjC
Common
Native
1.8

ObjCName

Instructs the Kotlin compiler to use a custom Objective-C and/or Swift name for this class, property, parameter or function.

annotation class ObjCName
Native
1.9

ObsoleteNativeApi

This annotation marks the Kotlin/Native standard library API that is considered obsolete and is being phased out.

annotation class ObsoleteNativeApi
Common
Native
1.8

RefinesInSwift

Meta-annotation that instructs the Kotlin compiler to mark the annotated function or property as swift_private in the generated Objective-C API.

annotation class RefinesInSwift
Common
Native
1.8

ShouldRefineInSwift

Instructs the Kotlin compiler to mark this function or property as swift_private in the generated Objective-C API.

annotation class ShouldRefineInSwift
Native
1.3

SymbolName

This is a dangerous deprecated and internal annotation. Please avoid using it.

annotation class SymbolName

Functions

Native
1.3

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>
Native
1.3

asUCPointer

Returns stable C pointer to data at certain offset, useful as a way to pass resource to C APIs.

fun ImmutableBlob.asUCPointer(
    offset: Int = 0
): CPointer<UByteVar>
Native
1.3

deinitRuntimeIfNeeded

Deinitializes Kotlin runtime for the current thread, if was inited. Cannot be called from Kotlin frames holding references, thus deprecated.

fun deinitRuntimeIfNeeded()
Native
1.3

getCharAt

Gets Char out of the ByteArray byte buffer at specified index index

fun ByteArray.getCharAt(index: Int): Char
Native
1.3

getDoubleAt

Gets Double out of the ByteArray byte buffer at specified index index

fun ByteArray.getDoubleAt(index: Int): Double
Native
1.3

getFloatAt

Gets Float out of the ByteArray byte buffer at specified index index

fun ByteArray.getFloatAt(index: Int): Float
Native
1.3

getIntAt

Gets Int out of the ByteArray byte buffer at specified index index

fun ByteArray.getIntAt(index: Int): Int
Native
1.3

getLongAt

Gets Long out of the ByteArray byte buffer at specified index index

fun ByteArray.getLongAt(index: Int): Long
Native
1.3

getShortAt

Gets Short out of the ByteArray byte buffer at specified index index

fun ByteArray.getShortAt(index: Int): Short
Native
1.3

getStackTraceAddresses

Returns a list of stack trace addresses representing the stack trace pertaining to this throwable.

fun Throwable.getStackTraceAddresses(): List<Long>
Native
1.3

getUByteAt

Gets UByte out of the ByteArray byte buffer at specified index index

fun ByteArray.getUByteAt(index: Int): UByte
Native
1.3

getUIntAt

Gets UInt out of the ByteArray byte buffer at specified index index

fun ByteArray.getUIntAt(index: Int): UInt
Native
1.3

getULongAt

Gets ULong out of the ByteArray byte buffer at specified index index

fun ByteArray.getULongAt(index: Int): ULong
Native
1.6

getUnhandledExceptionHook

Returns a user-defined unhandled exception hook set by setUnhandledExceptionHook or null if no user-defined hooks were set.

fun getUnhandledExceptionHook(): ReportUnhandledExceptionHook?
Native
1.3

getUShortAt

Gets UShort out of the ByteArray byte buffer at specified index index

fun ByteArray.getUShortAt(index: Int): UShort
Native
1.3

identityHashCode

Compute stable wrt potential object relocations by the memory manager identity hash code.

fun Any?.identityHashCode(): Int
Native
1.3

immutableBlobOf

Creates ImmutableBlob out of compile-time constant data.

fun immutableBlobOf(vararg elements: Short): ImmutableBlob
Native
1.3

initRuntimeIfNeeded

Initializes Kotlin runtime for the current thread, if not inited already.

fun initRuntimeIfNeeded()
Native
1.3

isExperimentalMM

fun isExperimentalMM(): Boolean
Native
1.6

processUnhandledException

Performs the default processing of unhandled exception.

fun processUnhandledException(throwable: Throwable)
Native
1.3

setCharAt

Sets Char out of the ByteArray byte buffer at specified index index

fun ByteArray.setCharAt(index: Int, value: Char)
Native
1.3

setDoubleAt

Sets Double out of the ByteArray byte buffer at specified index index

fun ByteArray.setDoubleAt(index: Int, value: Double)
Native
1.3

setFloatAt

Sets Float out of the ByteArray byte buffer at specified index index

fun ByteArray.setFloatAt(index: Int, value: Float)
Native
1.3

setIntAt

Sets Int out of the ByteArray byte buffer at specified index index

fun ByteArray.setIntAt(index: Int, value: Int)
Native
1.3

setLongAt

Sets Long out of the ByteArray byte buffer at specified index index

fun ByteArray.setLongAt(index: Int, value: Long)
Native
1.3

setShortAt

Sets Short out of the ByteArray byte buffer at specified index index

fun ByteArray.setShortAt(index: Int, value: Short)
Native
1.3

setUByteAt

Sets UByte out of the ByteArray byte buffer at specified index index

fun ByteArray.setUByteAt(index: Int, value: UByte)
Native
1.3

setUIntAt

Sets UInt out of the ByteArray byte buffer at specified index index

fun ByteArray.setUIntAt(index: Int, value: UInt)
Native
1.3

setULongAt

Sets ULong out of the ByteArray byte buffer at specified index index

fun ByteArray.setULongAt(index: Int, value: ULong)
Native
1.3

setUnhandledExceptionHook

Installs an unhandled exception hook and returns an old hook, or null if no user-defined hooks were previously set.

fun setUnhandledExceptionHook(
    hook: ReportUnhandledExceptionHook?
): ReportUnhandledExceptionHook?
fun setUnhandledExceptionHook(
    hook: ReportUnhandledExceptionHook
): ReportUnhandledExceptionHook?
Native
1.3

setUShortAt

Sets UShort out of the ByteArray byte buffer at specified index index

fun ByteArray.setUShortAt(index: Int, value: UShort)
Native
1.6

terminateWithUnhandledException

fun terminateWithUnhandledException(
    throwable: Throwable
): Nothing
Native
1.3

toByteArray

Copies the data from this blob into a new ByteArray.

fun ImmutableBlob.toByteArray(
    startIndex: Int = 0,
    endIndex: Int = size
): ByteArray
Native
1.3

toUByteArray

Copies the data from this blob into a new UByteArray.

fun ImmutableBlob.toUByteArray(
    startIndex: Int = 0,
    endIndex: Int = size
): UByteArray
Native
1.3

vectorOf

fun vectorOf(
    f0: Float,
    f1: Float,
    f2: Float,
    f3: Float
): Vector128
fun vectorOf(f0: Int, f1: Int, f2: Int, f3: Int): Vector128