, , - - . , - .
. , , .
:
private void TestBoxing()
{
int i = 52;
object io = i;
io = "something else";
}
IL:
.method private hidebysig instance void TestBoxing() cil managed
{
// Code size 18 (0x12)
.maxstack 1
.locals init ([0] int32 i,
[1] object io)
IL_0000: nop
IL_0001: ldc.i4.s 52
IL_0003: stloc.0
IL_0004: ldloc.0
IL_0005: box [mscorlib]System.Int32
IL_000a: stloc.1
IL_000b: ldstr "something else"
IL_0010: stloc.1
IL_0011: ret
} // end of method Program::TestBoxing
, .locals init ([0] int32 i, [1] object io) - , , int .
()
,
, , , 4 4- , , , int 4 12 .
(2)
, , , CLR (32 64 ), CLR . , GC, .