Conversation

Replying to
Technically, they are correct. You have the stack pointer, you can put data there and increase the pointer. That’s it. On heap, the OS’s memory management has to search for the right page, find an empty one, etc., etc.
1
Replying to and
Stacks still use the same virtual memory system as the rest of the address space. When you go deeper on the stack than you have before it still triggers acquiring pages the same way as touching newly allocated memory from a userspace allocator. Both end up coming from mmap, etc.
1
1
A secondary thread call stack and memory obtained by a userspace allocator are typically obtained from the OS the same way. You can use memory from a userspace allocator as a call stack or memory on the stack as the backing for a userspace allocator. It's about how it's used.
1