ObjectLayoutInspector icon indicating copy to clipboard operation
ObjectLayoutInspector copied to clipboard

Support nullable as stucture with 2 fields?

Open dzmitry-lahoda opened this issue 5 years ago • 0 comments

   [TestFixture]
    public class NullableTests
    {
        [Test]
        public void NullableLongByteStruct()
        {
            TypeLayout.PrintLayout<Nullable<LongByteStruct>>();            
            var typeLayout = TypeLayout.GetLayout<Nullable<LongByteStruct>>(includePaddings: true);
            var size = Unsafe.SizeOf<Nullable<LongByteStruct>>();
            Assert.AreEqual(typeLayout.Size, 123);
        }
    }
Standard Output Messages:
 Type layout for 'Nullable`1'
 Size: 24 bytes. Paddings: 0 bytes (%0 of empty space)
 ||
 ||

dzmitry-lahoda avatar Mar 11 '19 15:03 dzmitry-lahoda