[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:
Alexander Shabalin
2022-09-23 15:07:16 +00:00
committed by Space
parent 9210108d5a
commit f009d9b633
12 changed files with 74 additions and 5 deletions
@@ -56,6 +56,7 @@ sealed class ClangArgs(
"REPORT_BACKTRACE_TO_IOS_CRASH_LOG".takeIf { target.supportsIosCrashLog() },
"NEED_SMALL_BINARY".takeIf { target.needSmallBinary() },
"TARGET_HAS_ADDRESS_DEPENDENCY".takeIf { target.hasAddressDependencyInMemoryModel() },
"SUPPORTS_GRAND_CENTRAL_DISPATCH".takeIf { target.supportsGrandCentralDispatch },
).map { "KONAN_$it=1" }
val otherOptions = listOfNotNull(
"USE_ELF_SYMBOLS=1".takeIf { target.binaryFormat() == BinaryFormat.ELF },
@@ -172,6 +172,11 @@ fun KonanTarget.hasAddressDependencyInMemoryModel(): Boolean =
Architecture.MIPS32, Architecture.MIPSEL32, Architecture.WASM32 -> false
}
val KonanTarget.supportsGrandCentralDispatch
get() = when(family) {
Family.WATCHOS, Family.IOS, Family.TVOS, Family.OSX -> true
else -> false
}
// TODO: this is bad function. It should be replaced by capabilities functions like above
// but two affected targets are too strange, so we postpone it