4 ms·
woah. You're right. Learned something new. Why ever would they do that?
by crimsonalucard 8y ago
woah. You're right. Learned something new. Why ever would they do that?
- saagarjha 8y agoThis is how most interpreted languages work. The actual hardware stack (e.g. what $rsp points to) isn’t really relevant to the Python program being executed; it’s used by the native code in the interpreter itself. Pushing a Python stack frame intermingled with a hardware stack frame would be odd (and would likely be hard to do, and weird from an ABI perspective). It’s just easier to push the call stack to a dedicated section on the heap; the Python program doesn’t know the difference anyways. Plus, you can have a much larger stack by heap allocating it.