我想弄清楚如何在 C# 中存储数据。例如,当 IL 运算符 Stloc 获取堆栈的顶部值并将其放入局部变量时,这个变量本身存储在哪里?例如,
static void Main()
{
{
int x = 5;
}
}
在 Il-notation 中,这是
.method private hidebysig static void Main() cil managed
{
.entrypoint
.maxstack 1
.locals init (
[0] int32 num)
L_0000: nop
L_0001: nop
L_0002: ldc.i4.5
L_0003: stloc.0 <---В какую область памяти упадет значение из стека?
L_0004: nop
L_0005: ret
}