diff options
| author | Andrey Sukharev <SukharevAndrey@users.noreply.github.com> | 2022-12-12 17:10:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-12 15:10:05 +0100 |
| commit | edf7e628cadd51e019f6d3723d120e727e50d32e (patch) | |
| tree | 79335f6fdaeb15e3dd98ab3fa31e359843018cd6 /Ryujinx.Tests.Unicorn/Native/Interface.cs | |
| parent | ba5c0cf5d8e4ea27fc62cd181ef65b8ff39f0fd5 (diff) | |
Use method overloads that support trimming. Mark some types to be trimming friendly (#4083)
* Use method overloads that support trimming. Mark some types to be trimming friendly
* Use generic version of marshalling method
Diffstat (limited to 'Ryujinx.Tests.Unicorn/Native/Interface.cs')
| -rw-r--r-- | Ryujinx.Tests.Unicorn/Native/Interface.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Ryujinx.Tests.Unicorn/Native/Interface.cs b/Ryujinx.Tests.Unicorn/Native/Interface.cs index 0ecda22e..889441ab 100644 --- a/Ryujinx.Tests.Unicorn/Native/Interface.cs +++ b/Ryujinx.Tests.Unicorn/Native/Interface.cs @@ -1,5 +1,6 @@ using Ryujinx.Tests.Unicorn.Native.Const; using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.InteropServices; @@ -43,9 +44,9 @@ namespace Ryujinx.Tests.Unicorn.Native } } - public static void MarshalArrayOf<T>(IntPtr input, int length, out T[] output) + public static void MarshalArrayOf<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T>(IntPtr input, int length, out T[] output) { - int size = Marshal.SizeOf(typeof(T)); + int size = Marshal.SizeOf<T>(); output = new T[length]; |
