3 ms·
Hehe, it happens. Speaking of memory allocation, the stack is named that way because it's an actual stack and most function calls receive parameters through it
by bad_user 13y ago
Hehe, it happens.
Speaking of memory allocation, the stack is named that way because it's an actual stack and most function calls receive parameters through it and return their results through it. This is why it's cheaper to store things on the stack, because if you want to use a value from memory, it's going to end up on that stack anyway (e.g. boxing / unboxing), not to mention that items get allocated and deallocated in LIFO order, so you've got no issues with searching for available space or fragmentation.