[K/N] Put FinalizerProcessor CFRunLoop usage under a flag ^KT-64313

This commit is contained in:
Alexander Shabalin
2024-01-04 11:37:26 +01:00
committed by Space Team
parent 8ff869a08c
commit 5208b3c024
6 changed files with 54 additions and 21 deletions
@@ -65,6 +65,8 @@ object BinaryOptions : BinaryOptionRegistry() {
val objcDisposeOnMain by booleanOption()
val objcDisposeWithRunLoop by booleanOption()
val disableMmap by booleanOption()
val disableAllocatorOverheadEstimate by booleanOption()
@@ -245,6 +245,10 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
configuration.get(BinaryOptions.objcDisposeOnMain) ?: true
}
val objcDisposeWithRunLoop: Boolean by lazy {
configuration.get(BinaryOptions.objcDisposeWithRunLoop) ?: true
}
val enableSafepointSignposts: Boolean = configuration.get(BinaryOptions.enableSafepointSignposts)?.also {
if (it && !target.supportsSignposts) {
configuration.report(CompilerMessageSeverity.STRONG_WARNING, "Signposts are not available on $target. The setting will have no effect.")
@@ -2817,6 +2817,7 @@ internal class CodeGeneratorVisitor(
overrideRuntimeGlobal("Kotlin_mimallocUseDefaultOptions", llvm.constInt32(if (context.config.mimallocUseDefaultOptions) 1 else 0))
overrideRuntimeGlobal("Kotlin_mimallocUseCompaction", llvm.constInt32(if (context.config.mimallocUseCompaction) 1 else 0))
overrideRuntimeGlobal("Kotlin_objcDisposeOnMain", llvm.constInt32(if (context.config.objcDisposeOnMain) 1 else 0))
overrideRuntimeGlobal("Kotlin_objcDisposeWithRunLoop", llvm.constInt32(if (context.config.objcDisposeWithRunLoop) 1 else 0))
overrideRuntimeGlobal("Kotlin_enableSafepointSignposts", llvm.constInt32(if (context.config.enableSafepointSignposts) 1 else 0))
}