diff --git a/Core/InteropServices/SafeMemoryHandle.cs b/Core/InteropServices/SafeMemoryHandle.cs index 6297406a..cabcf84b 100644 --- a/Core/InteropServices/SafeMemoryHandle.cs +++ b/Core/InteropServices/SafeMemoryHandle.cs @@ -367,7 +367,7 @@ namespace Vanara.InteropServices if (IsInvalid) return null; //if (Size < Marshal.SizeOf(typeof(T)) * count + prefixBytes) // throw new InsufficientMemoryException("Requested array is larger than the memory allocated."); - if (!typeof(T).IsBlittable()) throw new ArgumentException(@"Structure layout is not sequential or explicit."); + //if (!typeof(T).IsBlittable()) throw new ArgumentException(@"Structure layout is not sequential or explicit."); Debug.Assert(typeof(T).StructLayoutAttribute?.Value == LayoutKind.Sequential); return handle.ToArray(count, prefixBytes, sz); } @@ -384,7 +384,7 @@ namespace Vanara.InteropServices if (IsInvalid) return new T[0]; //if (Size < Marshal.SizeOf(typeof(T)) * count + prefixBytes) // throw new InsufficientMemoryException("Requested array is larger than the memory allocated."); - if (!typeof(T).IsBlittable()) throw new ArgumentException(@"Structure layout is not sequential or explicit."); + //if (!typeof(T).IsBlittable()) throw new ArgumentException(@"Structure layout is not sequential or explicit."); Debug.Assert(typeof(T).StructLayoutAttribute?.Value == LayoutKind.Sequential); return handle.ToIEnum(count, prefixBytes, sz); }