From 00c39f6a1d8dc82d52d85ac772eaf2a022e7d83b Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 3 Dec 2025 12:37:17 -0500 Subject: [PATCH 1/2] usePinned V1877473314 --- .../kotlin/runtime/util/SystemDefaultProviderBase.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/util/SystemDefaultProviderBase.kt b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/util/SystemDefaultProviderBase.kt index 1bee4e4ff..bc9b66f02 100644 --- a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/util/SystemDefaultProviderBase.kt +++ b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/util/SystemDefaultProviderBase.kt @@ -27,9 +27,10 @@ public abstract class SystemDefaultProviderBase : PlatformProvider { try { // Read file content - val buffer = ByteArray(size).pin() - val rc = fread(buffer.addressOf(0), 1uL, size.toULong(), file) - if (rc == size.toULong()) buffer.get() else null + ByteArray(size).usePinned { buffer -> + val rc = fread(buffer.addressOf(0), 1uL, size.toULong(), file) + if (rc == size.toULong()) buffer.get() else null + } } finally { fclose(file) } From b2e4a0a48398c086f1274273b59fe8f33efe5611 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 3 Dec 2025 12:45:05 -0500 Subject: [PATCH 2/2] CI