[K/N] Make GlobalData be initialized lazily ^KT-64313
This commit is contained in:
committed by
Space Team
parent
7429dd4b94
commit
7d35c1087e
+2
@@ -78,6 +78,8 @@ object BinaryOptions : BinaryOptionRegistry() {
|
||||
val packFields by booleanOption()
|
||||
|
||||
val cInterfaceMode by option<CInterfaceGenerationMode>()
|
||||
|
||||
val globalDataLazyInit by booleanOption()
|
||||
}
|
||||
|
||||
open class BinaryOption<T : Any>(
|
||||
|
||||
+4
@@ -262,6 +262,10 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
}
|
||||
} ?: target.supportsSignposts
|
||||
|
||||
val globalDataLazyInit: Boolean by lazy {
|
||||
configuration.get(BinaryOptions.globalDataLazyInit) ?: true
|
||||
}
|
||||
|
||||
init {
|
||||
if (!platformManager.isEnabled(target)) {
|
||||
error("Target ${target.visibleName} is not available on the ${HostManager.hostName} host")
|
||||
|
||||
+1
@@ -2819,6 +2819,7 @@ internal class CodeGeneratorVisitor(
|
||||
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))
|
||||
overrideRuntimeGlobal("Kotlin_globalDataLazyInit", llvm.constInt32(if (context.config.globalDataLazyInit) 1 else 0))
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------//
|
||||
|
||||
Reference in New Issue
Block a user