In Java, a byte
or short
is stored in the JVM's 'natural' word length, i.e. for the most part, 32-bits. An exception would be an array of bytes, where each byte occupies a byte of memory.
Does the CLR do the same thing?
If it does do this, in what situations are there exceptions to this? E.g. How much memory does this occupy?
struct MyStruct
{
short s1;
short s2;
}