public void TestPadded() { var obj = new Padded { B = 1, L = 2 }; Assert.AreEqual(Padded.DebuggerSize, obj.GetExclusiveSize()); }
public static unsafe void Main (string[] args) { var buffer = new byte[32]; fixed (byte *pBuffer = buffer) { Array.Clear(buffer, 0, 32); *((Padded*)pBuffer) = new Padded { A = 0x1B, B = 0xFAEBDCCD, C = 3.3f }; Util.PrintBytes(buffer); Console.WriteLine(*((Padded*)pBuffer)); Console.WriteLine(Marshal.SizeOf(typeof(Padded))); } }
public override int GetHashCode() { int hashcode = 157; unchecked { if (isset.padded) { hashcode = (hashcode * 397) + Padded.GetHashCode(); } if (isset.logical) { hashcode = (hashcode * 397) + Logical.GetHashCode(); } } return(hashcode); }
public static unsafe void Main(string[] args) { var buffer = new byte[32]; fixed(byte *pBuffer = buffer) { Array.Clear(buffer, 0, 32); *((Padded *)pBuffer) = new Padded { A = 0x1B, B = 0xFAEBDCCD, C = 3.3f }; Util.PrintBytes(buffer); Console.WriteLine(*((Padded *)pBuffer)); Console.WriteLine(Marshal.SizeOf(typeof(Padded))); } }