[K/N] Mark kotlin.native.ref.Cleaner with @ExperimentalNativeApi
As a part of efforts to stabilize Native stdlib #KT-55765.
This commit is contained in:
committed by
Space Team
parent
16078ae8e8
commit
0bd263b12a
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package kotlin.native.internal
|
package kotlin.native.internal
|
||||||
|
|
||||||
|
import kotlin.experimental.ExperimentalNativeApi
|
||||||
import kotlin.native.concurrent.*
|
import kotlin.native.concurrent.*
|
||||||
import kotlinx.cinterop.NativePtr
|
import kotlinx.cinterop.NativePtr
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ public interface Cleaner
|
|||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalStdlibApi
|
||||||
@ExportForCompiler
|
@ExportForCompiler
|
||||||
@OptIn(FreezingIsDeprecated::class)
|
@OptIn(ExperimentalNativeApi::class)
|
||||||
fun <T> createCleaner(argument: T, block: (T) -> Unit): Cleaner =
|
fun <T> createCleaner(argument: T, block: (T) -> Unit): Cleaner =
|
||||||
kotlin.native.ref.createCleanerImpl(argument, block) as Cleaner
|
kotlin.native.ref.createCleanerImpl(argument, block) as Cleaner
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package kotlin.native.ref
|
package kotlin.native.ref
|
||||||
|
|
||||||
|
import kotlin.experimental.ExperimentalNativeApi
|
||||||
import kotlin.native.concurrent.isShareable
|
import kotlin.native.concurrent.isShareable
|
||||||
import kotlin.native.concurrent.freeze
|
import kotlin.native.concurrent.freeze
|
||||||
import kotlin.native.internal.*
|
import kotlin.native.internal.*
|
||||||
@@ -15,7 +16,7 @@ import kotlinx.cinterop.NativePtr
|
|||||||
*
|
*
|
||||||
* Use [createCleaner] to create an instance of this type.
|
* Use [createCleaner] to create an instance of this type.
|
||||||
*/
|
*/
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalNativeApi
|
||||||
@SinceKotlin("1.9")
|
@SinceKotlin("1.9")
|
||||||
public sealed interface Cleaner
|
public sealed interface Cleaner
|
||||||
|
|
||||||
@@ -83,13 +84,13 @@ public sealed interface Cleaner
|
|||||||
*/
|
*/
|
||||||
// TODO: Consider just annotating the lambda argument rather than hardcoding checking
|
// TODO: Consider just annotating the lambda argument rather than hardcoding checking
|
||||||
// by function name in the compiler.
|
// by function name in the compiler.
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalNativeApi
|
||||||
@SinceKotlin("1.9")
|
@SinceKotlin("1.9")
|
||||||
@ExportForCompiler
|
@ExportForCompiler
|
||||||
public fun <T> createCleaner(resource: T, cleanupAction: (resource: T) -> Unit): Cleaner =
|
public fun <T> createCleaner(resource: T, cleanupAction: (resource: T) -> Unit): Cleaner =
|
||||||
createCleanerImpl(resource, cleanupAction)
|
createCleanerImpl(resource, cleanupAction)
|
||||||
|
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalNativeApi
|
||||||
@OptIn(FreezingIsDeprecated::class)
|
@OptIn(FreezingIsDeprecated::class)
|
||||||
internal fun <T> createCleanerImpl(resource: T, cleanupAction: (T) -> Unit): Cleaner {
|
internal fun <T> createCleanerImpl(resource: T, cleanupAction: (T) -> Unit): Cleaner {
|
||||||
if (!resource.isShareable())
|
if (!resource.isShareable())
|
||||||
@@ -110,7 +111,7 @@ internal fun <T> createCleanerImpl(resource: T, cleanupAction: (T) -> Unit): Cle
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
@ExperimentalStdlibApi
|
@ExperimentalNativeApi
|
||||||
@NoReorderFields
|
@NoReorderFields
|
||||||
@ExportTypeInfo("theCleanerImplTypeInfo")
|
@ExportTypeInfo("theCleanerImplTypeInfo")
|
||||||
@HasFinalizer
|
@HasFinalizer
|
||||||
|
|||||||
Reference in New Issue
Block a user