[K/N] custom-alloc: Encode consecutive free blocks ^KT-55364
Co-authored-by: Troels Lund <troels@google.com> Merge-request: KOTLIN-MR-662 Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
This commit is contained in:
committed by
Space Cloud
parent
7585a406e4
commit
388634e47d
+2
@@ -54,6 +54,8 @@ object BinaryOptions : BinaryOptionRegistry() {
|
||||
val compileBitcodeWithXcodeLlvm by booleanOption()
|
||||
|
||||
val objcDisposeOnMain by booleanOption()
|
||||
|
||||
val disableMmap by booleanOption()
|
||||
}
|
||||
|
||||
open class BinaryOption<T : Any>(
|
||||
|
||||
+17
@@ -123,6 +123,21 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
realGc
|
||||
}
|
||||
val runtimeAssertsMode: RuntimeAssertsMode get() = configuration.get(BinaryOptions.runtimeAssertionsMode) ?: RuntimeAssertsMode.IGNORE
|
||||
private val defaultDisableMmap get() = target.family == Family.MINGW
|
||||
val disableMmap: Boolean by lazy {
|
||||
when (configuration.get(BinaryOptions.disableMmap)) {
|
||||
null -> defaultDisableMmap
|
||||
true -> true
|
||||
false -> {
|
||||
if (target.family == Family.MINGW) {
|
||||
configuration.report(CompilerMessageSeverity.STRONG_WARNING, "MinGW target does not support mmap/munmap")
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val workerExceptionHandling: WorkerExceptionHandling get() = configuration.get(KonanConfigKeys.WORKER_EXCEPTION_HANDLING) ?: when (memoryModel) {
|
||||
MemoryModel.EXPERIMENTAL -> WorkerExceptionHandling.USE_HOOK
|
||||
else -> WorkerExceptionHandling.LEGACY
|
||||
@@ -434,6 +449,8 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
append("-gc-scheduler=${gcSchedulerType.name}")
|
||||
if (runtimeAssertsMode != RuntimeAssertsMode.IGNORE)
|
||||
append("-runtime_asserts=${runtimeAssertsMode.name}")
|
||||
if (disableMmap != defaultDisableMmap)
|
||||
append("-disable_mmap=${disableMmap}")
|
||||
}
|
||||
|
||||
private val userCacheFlavorString = buildString {
|
||||
|
||||
+1
@@ -2958,6 +2958,7 @@ internal fun NativeGenerationState.generateRuntimeConstantsModule() : LLVMModule
|
||||
|
||||
setRuntimeConstGlobal("Kotlin_needDebugInfo", llvm.constInt32(if (shouldContainDebugInfo()) 1 else 0))
|
||||
setRuntimeConstGlobal("Kotlin_runtimeAssertsMode", llvm.constInt32(config.runtimeAssertsMode.value))
|
||||
setRuntimeConstGlobal("Kotlin_disableMmap", llvm.constInt32(if (config.disableMmap) 1 else 0))
|
||||
val runtimeLogs = config.runtimeLogs?.let {
|
||||
static.cStringLiteral(it)
|
||||
} ?: NullPointer(llvm.int8Type)
|
||||
|
||||
Reference in New Issue
Block a user