Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a5e55f0

Browse files
committed
Call GetDynamicBuffer with lambdas instead of implicit delegates to reduce GC noise.
1 parent ca4ef03 commit a5e55f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.NativeCrypto.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,22 @@ private static extern int SetX509ChainVerifyTime(
8080

8181
internal static byte[] GetAsn1StringBytes(IntPtr asn1)
8282
{
83-
return GetDynamicBuffer(GetAsn1StringBytes, asn1);
83+
return GetDynamicBuffer((ptr, buf, i) => GetAsn1StringBytes(ptr, buf, i), asn1);
8484
}
8585

8686
internal static byte[] GetX509Thumbprint(SafeX509Handle x509)
8787
{
88-
return GetDynamicBuffer(GetX509Thumbprint, x509);
88+
return GetDynamicBuffer((handle, buf, i) => GetX509Thumbprint(handle, buf, i), x509);
8989
}
9090

9191
internal static byte[] GetX509NameRawBytes(IntPtr x509Name)
9292
{
93-
return GetDynamicBuffer(GetX509NameRawBytes, x509Name);
93+
return GetDynamicBuffer((ptr, buf, i) => GetX509NameRawBytes(ptr, buf, i), x509Name);
9494
}
9595

9696
internal static byte[] GetX509PublicKeyParameterBytes(SafeX509Handle x509)
9797
{
98-
return GetDynamicBuffer(GetX509PublicKeyParameterBytes, x509);
98+
return GetDynamicBuffer((handle, buf, i) => GetX509PublicKeyParameterBytes(handle, buf, i), x509);
9999
}
100100

101101
internal static void SetX509ChainVerifyTime(SafeX509StoreCtxHandle ctx, DateTime verifyTime)

0 commit comments

Comments
 (0)