From dd89efbce2181a18869ce37bd5eb6641a64cd17d Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Thu, 15 Feb 2024 19:36:45 +0200 Subject: [PATCH] [K/N] Remove deprecated deinitRuntimeIfNeeded #KT-65532 --- kotlin-native/runtime/src/launcher/cpp/androidLauncher.cpp | 2 +- kotlin-native/runtime/src/main/cpp/Runtime.cpp | 2 +- kotlin-native/runtime/src/main/cpp/Runtime.h | 2 +- .../runtime/src/main/kotlin/kotlin/native/Runtime.kt | 7 ------- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/kotlin-native/runtime/src/launcher/cpp/androidLauncher.cpp b/kotlin-native/runtime/src/launcher/cpp/androidLauncher.cpp index 27870495441..4bfc74db404 100644 --- a/kotlin-native/runtime/src/launcher/cpp/androidLauncher.cpp +++ b/kotlin-native/runtime/src/launcher/cpp/androidLauncher.cpp @@ -86,7 +86,7 @@ void launchMain() { } // TODO: Can we shutdown runtime here? - Kotlin_deinitRuntimeIfNeeded(); + deinitRuntimeIfNeeded(); } void* entry(void* param) { diff --git a/kotlin-native/runtime/src/main/cpp/Runtime.cpp b/kotlin-native/runtime/src/main/cpp/Runtime.cpp index 02089493f5d..cb9d27d0a13 100644 --- a/kotlin-native/runtime/src/main/cpp/Runtime.cpp +++ b/kotlin-native/runtime/src/main/cpp/Runtime.cpp @@ -196,7 +196,7 @@ RUNTIME_NOTHROW void Kotlin_initRuntimeIfNeeded() { } } -void Kotlin_deinitRuntimeIfNeeded() { +void deinitRuntimeIfNeeded() { if (isValidRuntime()) { deinitRuntime(::runtimeState, false); } diff --git a/kotlin-native/runtime/src/main/cpp/Runtime.h b/kotlin-native/runtime/src/main/cpp/Runtime.h index a7200125508..f0c1da1a18b 100644 --- a/kotlin-native/runtime/src/main/cpp/Runtime.h +++ b/kotlin-native/runtime/src/main/cpp/Runtime.h @@ -21,7 +21,7 @@ struct InitNode { // For experimental MM, if runtime gets initialized, it will be in the native state after this. RUNTIME_NOTHROW void Kotlin_initRuntimeIfNeeded(); -void Kotlin_deinitRuntimeIfNeeded(); +void deinitRuntimeIfNeeded(); // Can only be called once. // No new runtimes can be initialized on any thread after this. diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/Runtime.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/Runtime.kt index 8dd12e93e9d..300096b08b8 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/Runtime.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/Runtime.kt @@ -19,13 +19,6 @@ import kotlin.native.internal.ReportUnhandledException @Deprecated("Initializing runtime is not possible in the new memory model.", level = DeprecationLevel.WARNING) external public fun initRuntimeIfNeeded(): Unit -/** - * Deinitializes Kotlin runtime for the current thread, if was inited. - * Cannot be called from Kotlin frames holding references, thus deprecated. - */ -@GCUnsafeCall("Kotlin_deinitRuntimeIfNeeded") -@Deprecated("Deinit runtime can not be called from Kotlin", level = DeprecationLevel.ERROR) -external public fun deinitRuntimeIfNeeded(): Unit /** * Exception thrown when top level variable is accessed from incorrect execution context.