[K/N] Enable extra option for mimalloc ^KT-53182
Merge-request: KT-MR-6952 Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
This commit is contained in:
committed by
Space
parent
77ab69240e
commit
0734456a87
+2
@@ -40,6 +40,8 @@ object BinaryOptions : BinaryOptionRegistry() {
|
||||
val appStateTracking by option<AppStateTracking>()
|
||||
|
||||
val sanitizer by option<SanitizerKind>()
|
||||
|
||||
val mimallocUseDefaultOptions by booleanOption()
|
||||
}
|
||||
|
||||
open class BinaryOption<T : Any>(
|
||||
|
||||
+4
@@ -181,6 +181,10 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
configuration.get(BinaryOptions.appStateTracking) ?: AppStateTracking.DISABLED
|
||||
}
|
||||
|
||||
val mimallocUseDefaultOptions by lazy {
|
||||
configuration.get(BinaryOptions.mimallocUseDefaultOptions) ?: false
|
||||
}
|
||||
|
||||
init {
|
||||
if (!platformManager.isEnabled(target)) {
|
||||
error("Target ${target.visibleName} is not available on the ${HostManager.hostName} host")
|
||||
|
||||
+2
-1
@@ -2792,6 +2792,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
||||
overrideRuntimeGlobal("Kotlin_printToAndroidLogcat", Int32(if (programType.consolePrintsToLogcat) 1 else 0))
|
||||
}
|
||||
overrideRuntimeGlobal("Kotlin_appStateTracking", Int32(context.config.appStateTracking.value))
|
||||
overrideRuntimeGlobal("Kotlin_mimallocUseDefaultOptions", Int32(if (context.config.mimallocUseDefaultOptions) 1 else 0))
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------//
|
||||
@@ -2998,4 +2999,4 @@ internal fun Context.generateRuntimeConstantsModule() : LLVMModuleRef {
|
||||
setRuntimeConstGlobal("Kotlin_gcSchedulerType", Int32(config.gcSchedulerType.value))
|
||||
|
||||
return llvmModule
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user