Files
Abduqodiri Qurbonzoda e1c91ee50f [K/N] Move kotlin.native.internal.GC into kotlin.native.runtime
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:50 +03:00

30 lines
622 B
Kotlin

/*
* Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
@file:OptIn(ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.native.internal.*
import kotlin.native.runtime.GC
fun ensureInitialized() {}
fun createCleaner() {
createCleaner(42) {
println(it)
}
}
fun performGC() {
GC.collect()
performGCOnCleanerWorker()
}
private var globalCleaner: Cleaner? = null
fun initializeGlobalCleaner() {
globalCleaner = createCleaner(11) {
println(it)
}
}