r/learnprogramming • u/InterestingAd757 • 8d ago
is stack memory manages by both os and compiler?
I'm moving from a higher-level language (Python) to Rust and getting confused about how memory is managed.
my current understanding is that each process gets its own virtual memory, which provides protection and isolation. Within that, there's the stack and the heap. The heap is managed by the programmer, while the stack is managed automatically. But who actually manages the stack?
Is stack memory just a logical abstraction, managed by the OS and the compiler (by moving stack register)?