/ src / Ryujinx.HLE / Exceptions / InvalidStructLayoutException.cs
InvalidStructLayoutException.cs
 1  using System;
 2  using System.Runtime.CompilerServices;
 3  
 4  namespace Ryujinx.HLE.Exceptions
 5  {
 6      public class InvalidStructLayoutException<T> : Exception
 7      {
 8          static readonly Type _structType = typeof(T);
 9  
10          public InvalidStructLayoutException(string message) : base(message) { }
11  
12          public InvalidStructLayoutException(int expectedSize)
13              : base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, got: {Unsafe.SizeOf<T>()} bytes") { }
14      }
15  }