Remove forced dependency of new MM on mimalloc (#4617)

This commit is contained in:
Alexander Shabalin
2020-12-24 15:25:59 +03:00
committed by Nikolay Krasko
parent e753ce048e
commit 39805c72dc
2 changed files with 26 additions and 13 deletions
@@ -124,11 +124,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
MemoryModel.STRICT -> MemoryModel.STRICT
MemoryModel.RELAXED -> MemoryModel.RELAXED
MemoryModel.EXPERIMENTAL -> {
if (!target.supportsMimallocAllocator()) {
configuration.report(CompilerMessageSeverity.STRONG_WARNING,
"Experimental memory model requires mimalloc allocator. Used strict memory model.")
MemoryModel.STRICT
} else if (!target.supportsThreads()) {
if (!target.supportsThreads()) {
configuration.report(CompilerMessageSeverity.STRONG_WARNING,
"Experimental memory model requires threads, which are not supported on target ${target.name}. Used strict memory model.")
MemoryModel.STRICT
@@ -141,9 +137,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
}
}
}
val useMimalloc = if (effectiveMemoryModel == MemoryModel.EXPERIMENTAL) {
true // we already checked that target supports mimalloc.
} else if (configuration.get(KonanConfigKeys.ALLOCATION_MODE) == "mimalloc") {
val useMimalloc = if (configuration.get(KonanConfigKeys.ALLOCATION_MODE) == "mimalloc") {
if (target.supportsMimallocAllocator()) {
true
} else {
+24 -5
View File
@@ -140,8 +140,8 @@ targetList.forEach { targetName ->
createTestTask(
project,
"ExperimentalMM",
"${targetName}ExperimentalMMRuntimeTests",
"ExperimentalMMMimalloc",
"${targetName}ExperimentalMMMimallocRuntimeTests",
listOf(
"${targetName}Runtime",
"${targetName}ExperimentalMemoryManager",
@@ -153,10 +153,25 @@ targetList.forEach { targetName ->
includeRuntime()
}
createTestTask(
project,
"ExperimentalMMStdAlloc",
"${targetName}ExperimentalMMStdAllocRuntimeTests",
listOf(
"${targetName}Runtime",
"${targetName}ExperimentalMemoryManager",
"${targetName}Release",
"${targetName}StdAlloc"
)
) {
includeRuntime()
}
tasks.register("${targetName}RuntimeTests") {
dependsOn("${targetName}StdAllocRuntimeTests")
dependsOn("${targetName}MimallocRuntimeTests")
dependsOn("${targetName}ExperimentalMMRuntimeTests")
dependsOn("${targetName}ExperimentalMMStdAllocRuntimeTests")
dependsOn("${targetName}ExperimentalMMMimallocRuntimeTests")
}
}
@@ -176,8 +191,12 @@ val hostMimallocRuntimeTests by tasks.registering {
dependsOn("${hostName}MimallocRuntimeTests")
}
val hostExperimentalMMRuntimeTests by tasks.registering {
dependsOn("${hostName}ExperimentalMMRuntimeTests")
val hostExperimentalMMStdAllocRuntimeTests by tasks.registering {
dependsOn("${hostName}ExperimentalMMStdAllocRuntimeTests")
}
val hostExperimentalMMMimallocRuntimeTests by tasks.registering {
dependsOn("${hostName}ExperimentalMMMimallocRuntimeTests")
}
val assemble by tasks.registering {