Closed
Description
Use System.Runtime.CompilerServices.Unsafe.SizeOf<T>()
and ValueTuple
to do the test, seems it's always the same on different version of .net.(x86 aligned to 4 bytes)
Don't know why it need such a big padding, and use 3 more times(1 more time for x86) memory than it actually needed.
Type | Length |
---|---|
byte? | 2 |
short | 2 |
ValueTuple<byte?> | 2 |
ValueTuple | 2 |
ValueTuple<short, short> | 4 |
ValueTuple<byte?, byte?> | 16 |
ValueTuple<short, short, short> | 8 |
ValueTuple<byte?, byte?, byte?> | 24 |