3 ms·
Could you elaborate on "Stack space is allocated by generated code" Are you talking about the C runtime in the binary? Thanks.
by bogomipz 11y ago
Could you elaborate on "Stack space is allocated by generated code" Are you talking about the C runtime in the binary? Thanks.
- dfox 11y agoNo. Typical C function looks something like this: push %rbp mov %rsp, %rbp sub $something, %rsp ... actual code ... mov %rbp, %rsp ret The sub $something, %rsp instruction is everything that user-space does to allocate stack memory. Actual allocation of stack pages happens in kernel in a way that is completely transparent as long as the $something does not get unreasonably large.