Put GC implementations into separate modules.

The mm module now compiles separately for each GC implementation.
This commit is contained in:
Alexander Shabalin
2021-05-04 10:23:16 +00:00
committed by Space
parent 41ab97ff1f
commit 5e456ed82b
21 changed files with 230 additions and 89 deletions
+70 -5
View File
@@ -41,10 +41,13 @@ bitcode {
"${target}Objc",
"${target}ExceptionsSupport",
"${target}LegacyMemoryManager",
"${target}ExperimentalMemoryManager"
"${target}ExperimentalMemoryManagerNoop",
"${target}ExperimentalMemoryManagerStms",
"${target}CommonGc",
"${target}SingleThreadMsGc",
"${target}NoopGc"
)
includeRuntime()
// TODO: Should depend on the sanitizer.
}
create("mimalloc") {
@@ -103,7 +106,28 @@ bitcode {
includeRuntime()
}
create("experimental_memory_manager", file("src/mm")) {
create("experimental_memory_manager_noop", file("src/mm")) {
headersDirs += files("src/gc/noop/cpp", "src/gc/common/cpp")
includeRuntime()
}
create("experimental_memory_manager_stms", file("src/mm")) {
headersDirs += files("src/gc/stms/cpp", "src/gc/common/cpp")
includeRuntime()
}
create("common_gc", file("src/gc/common")) {
headersDirs += files("src/mm/cpp")
includeRuntime()
}
create("noop_gc", file("src/gc/noop")) {
headersDirs += files("src/gc/noop/cpp", "src/gc/common/cpp", "src/mm/cpp")
includeRuntime()
}
create("single_thread_ms_gc", file("src/gc/stms")) {
headersDirs += files("src/gc/stms/cpp", "src/gc/common/cpp", "src/mm/cpp")
includeRuntime()
}
}
@@ -148,12 +172,15 @@ targetList.forEach { targetName ->
"${targetName}ExperimentalMMMimallocRuntimeTests",
listOf(
"${targetName}Runtime",
"${targetName}ExperimentalMemoryManager",
"${targetName}ExperimentalMemoryManagerStms",
"${targetName}CommonGc",
"${targetName}SingleThreadMsGc",
"${targetName}Release",
"${targetName}Mimalloc",
"${targetName}OptAlloc"
)
) {
headersDirs += files("src/gc/stms/cpp", "src/gc/common/cpp", "src/mm/cpp")
includeRuntime()
})
@@ -163,11 +190,49 @@ targetList.forEach { targetName ->
"${targetName}ExperimentalMMStdAllocRuntimeTests",
listOf(
"${targetName}Runtime",
"${targetName}ExperimentalMemoryManager",
"${targetName}ExperimentalMemoryManagerStms",
"${targetName}CommonGc",
"${targetName}SingleThreadMsGc",
"${targetName}Release",
"${targetName}StdAlloc"
)
) {
headersDirs += files("src/gc/stms/cpp", "src/gc/common/cpp", "src/mm/cpp")
includeRuntime()
})
allTests.addAll(createTestTasks(
project,
targetName,
"${targetName}ExperimentalMMNoOpMimallocRuntimeTests",
listOf(
"${targetName}Runtime",
"${targetName}ExperimentalMemoryManagerNoop",
"${targetName}CommonGc",
"${targetName}NoopGc",
"${targetName}Release",
"${targetName}Mimalloc",
"${targetName}OptAlloc"
)
) {
headersDirs += files("src/gc/noop/cpp", "src/gc/common/cpp", "src/mm/cpp")
includeRuntime()
})
allTests.addAll(createTestTasks(
project,
targetName,
"${targetName}ExperimentalMMNoOpStdAllocRuntimeTests",
listOf(
"${targetName}Runtime",
"${targetName}ExperimentalMemoryManagerNoop",
"${targetName}CommonGc",
"${targetName}NoopGc",
"${targetName}Release",
"${targetName}StdAlloc"
)
) {
headersDirs += files("src/gc/noop/cpp", "src/gc/common/cpp", "src/mm/cpp")
includeRuntime()
})