[K/N] Manually compact mimalloc heap ^KT-53182
Merge-request: KT-MR-7111 Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
This commit is contained in:
committed by
Space
parent
9210108d5a
commit
f009d9b633
+2
@@ -44,6 +44,8 @@ object BinaryOptions : BinaryOptionRegistry() {
|
||||
val sanitizer by option<SanitizerKind>()
|
||||
|
||||
val mimallocUseDefaultOptions by booleanOption()
|
||||
|
||||
val mimallocUseCompaction by booleanOption()
|
||||
}
|
||||
|
||||
open class BinaryOption<T : Any>(
|
||||
|
||||
+5
@@ -188,6 +188,11 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
configuration.get(BinaryOptions.mimallocUseDefaultOptions) ?: false
|
||||
}
|
||||
|
||||
val mimallocUseCompaction by lazy {
|
||||
// Turned off by default, because it slows down allocation.
|
||||
configuration.get(BinaryOptions.mimallocUseCompaction) ?: false
|
||||
}
|
||||
|
||||
init {
|
||||
if (!platformManager.isEnabled(target)) {
|
||||
error("Target ${target.visibleName} is not available on the ${HostManager.hostName} host")
|
||||
|
||||
+1
@@ -2794,6 +2794,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
||||
}
|
||||
overrideRuntimeGlobal("Kotlin_appStateTracking", Int32(context.config.appStateTracking.value))
|
||||
overrideRuntimeGlobal("Kotlin_mimallocUseDefaultOptions", Int32(if (context.config.mimallocUseDefaultOptions) 1 else 0))
|
||||
overrideRuntimeGlobal("Kotlin_mimallocUseCompaction", Int32(if (context.config.mimallocUseCompaction) 1 else 0))
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------//
|
||||
|
||||
Reference in New Issue
Block a user