3 ms·
doesn't that apply to any other function call also? (though obviously alloca can let you do it really fast)
by Palomides 6y ago
doesn't that apply to any other function call also? (though obviously alloca can let you do it really fast)
- majewsky 6y agoIIRC, there's a protected page between the stack and the heap, where any reads or writes will `kill -SEGV` the program. With regular function calls, you'll be advancing the stack pointer slowly enough to guarantee a hit on that page. With alloca(), you can move the stack pointer in larger steps, thus missing that page. (The lowest few pages of memory are protected in the same way to increase the likelihood that a NUL pointer correctly blows up in your face when you try to access its memory.)