[K/N] Turn on mimalloc by default for experimental MM
This commit is contained in:
@@ -205,7 +205,6 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
})
|
||||
put(STATIC_FRAMEWORK, selectFrameworkType(configuration, arguments, outputKind))
|
||||
put(OVERRIDE_CLANG_OPTIONS, arguments.clangOptions.toNonNullList())
|
||||
put(ALLOCATION_MODE, arguments.allocator)
|
||||
|
||||
put(EXPORT_KDOC, arguments.exportKDoc)
|
||||
|
||||
@@ -340,6 +339,20 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
false
|
||||
}
|
||||
})
|
||||
put(ALLOCATION_MODE, when (arguments.allocator) {
|
||||
null -> {
|
||||
when (memoryModel) {
|
||||
MemoryModel.EXPERIMENTAL -> "mimalloc"
|
||||
else -> "std"
|
||||
}
|
||||
}
|
||||
"std" -> arguments.allocator!!
|
||||
"mimalloc" -> arguments.allocator!!
|
||||
else -> {
|
||||
configuration.report(ERROR, "Expected 'std' or 'mimalloc' for allocator")
|
||||
"std"
|
||||
}
|
||||
})
|
||||
put(WORKER_EXCEPTION_HANDLING, when (arguments.workerExceptionHandling) {
|
||||
null -> if (memoryModel == MemoryModel.EXPERIMENTAL) WorkerExceptionHandling.USE_HOOK else WorkerExceptionHandling.LEGACY
|
||||
"legacy" -> WorkerExceptionHandling.LEGACY
|
||||
|
||||
+1
-1
@@ -289,7 +289,7 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
var clangOptions: Array<String>? = null
|
||||
|
||||
@Argument(value="-Xallocator", valueDescription = "std | mimalloc", description = "Allocator used in runtime")
|
||||
var allocator: String = "std"
|
||||
var allocator: String? = null
|
||||
|
||||
@Argument(value = "-Xmetadata-klib", description = "Produce a klib that only contains the declarations metadata")
|
||||
var metadataKlib: Boolean = false
|
||||
|
||||
Reference in New Issue
Block a user