Use nint keyword not IntPtr type

This commit is contained in:
Oliver Booth 2022-11-30 19:24:58 +00:00
parent 031450ca7e
commit 1032313dff
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ internal sealed class Utf8StringToNative : ICustomMarshaler
fixed (byte* data = &MemoryMarshal.GetReference(utf8Bytes))
{
IntPtr buffer = Marshal.AllocHGlobal(utf8Bytes.Length + 1);
nint buffer = Marshal.AllocHGlobal(utf8Bytes.Length + 1);
Buffer.MemoryCopy(data, (void*)buffer, utf8Bytes.Length, utf8Bytes.Length);
Marshal.WriteByte(buffer, utf8Bytes.Length, 0);
return buffer;