From 2e5a110a3ea9519a67c34372c1dcd6af5b4d96bd Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Mon, 24 Jan 2022 19:28:17 +0500 Subject: [PATCH] [K/N][gradle] Fixed platform libraries generation --- .../kotlin/cli/utilities/GeneratePlatformLibraries.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kotlin-native/utilities/cli-runner/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/GeneratePlatformLibraries.kt b/kotlin-native/utilities/cli-runner/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/GeneratePlatformLibraries.kt index 1405a4ed7e2..0e38f54c54f 100644 --- a/kotlin-native/utilities/cli-runner/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/GeneratePlatformLibraries.kt +++ b/kotlin-native/utilities/cli-runner/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/GeneratePlatformLibraries.kt @@ -25,6 +25,7 @@ import java.nio.file.Files import java.nio.file.Paths import java.util.concurrent.atomic.AtomicInteger import kotlin.system.exitProcess +import org.jetbrains.kotlin.konan.util.usingNativeMemoryAllocator // TODO: We definitely need to unify logging in different parts of the compiler. private class Logger(val level: Level = Level.NORMAL) { @@ -65,7 +66,7 @@ private enum class CacheKind(val outputKind: CompilerOutputKind) { } // TODO: Use Distribution's paths after compiler update. -fun generatePlatformLibraries(args: Array) { +fun generatePlatformLibraries(args: Array) = usingNativeMemoryAllocator { // IMPORTANT! These command line keys are used by the Gradle plugin to configure platform libraries generation, // so any changes in them must be reflected at the Gradle plugin side too. // See org.jetbrains.kotlin.gradle.targets.native.internal.PlatformLibrariesGenerator in the Big Kotlin repo.