今天的PC有大量的物理RAM,但是C#的堆栈大小对于32位进程只有1 MB而对于64位进程只有4 MB(C#中的堆栈容量).
为什么CLR中的堆栈大小仍然如此有限?
为什么它恰好是1 MB(4 MB)(而不是2 MB或512 KB)?为什么决定使用这些金额?
我对该决定背后的考虑因素和原因感兴趣.
当我将“调试”设置为“x86”时,以下代码有效
.386
.model flat, stdcall
.stack 4096
ExitProcess PROTO, dwExitCode: DWORD
.data
; define your variables here
.code
main PROC
; write your assembly code herer
mov eax ,3
mov ebx ,8
add eax, ebx
INVOKE ExitProcess ,0
main ENDP
END main
Run Code Online (Sandbox Code Playgroud)
如果我尝试像 rax 一样使用“64位”寄存器,它也会失败