From 300ef9f88e8a604dd058ffbe03916501f6687313 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 22 May 2023 11:41:19 -0700 Subject: [PATCH] fix unnecessary copy in PackFontRanges --- src/Graphics/Font/Packer.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Graphics/Font/Packer.cs b/src/Graphics/Font/Packer.cs index 198ea3b8..9fa053ca 100644 --- a/src/Graphics/Font/Packer.cs +++ b/src/Graphics/Font/Packer.cs @@ -29,13 +29,7 @@ namespace MoonWorks.Graphics.Font fixed (FontRange *pFontRanges = &fontRanges[0]) { var nativeSize = fontRanges.Length * Marshal.SizeOf(); - void* fontRangeMemory = NativeMemory.Alloc((nuint) fontRanges.Length, (nuint) Marshal.SizeOf()); - System.Buffer.MemoryCopy(pFontRanges, fontRangeMemory, nativeSize, nativeSize); - - var result = Wellspring.Wellspring_PackFontRanges(Handle, (IntPtr) fontRangeMemory, (uint) fontRanges.Length); - - NativeMemory.Free(fontRangeMemory); - + var result = Wellspring.Wellspring_PackFontRanges(Handle, (IntPtr) pFontRanges, (uint) fontRanges.Length); return result > 0; } }