Does the CLR store small values in 'natural' sized locations?

Posted by izb on Stack Overflow See other posts from Stack Overflow or by izb
Published on 2010-03-29T12:35:06Z Indexed on 2010/03/29 13:53 UTC
Read the original article Hit count: 559

Filed under:
|
|

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;
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about clr