e1c91ee50f
As a part of efforts to stabilize Native stdlib #KT-55765.
30 lines
622 B
Kotlin
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)
|
|
}
|
|
}
|