4 ms·
What's a little confusing here is that they talk about "static allocation" vs "dynamic allocation"; but these days, use of the stack is referred to as static al
by Sniffnoy 6y ago
What's a little confusing here is that they talk about "static allocation" vs "dynamic allocation"; but these days, use of the stack is referred to as static allocation! Even if it's not as fully static as the old way. The shift in terminology makes the old debate opaque for the modern reader, and without your comment (and some similar ones) I wouldn't have known what was going on.
- gumby 6y agoI have never seen that usage — in what community is it common? Thanks!
- deleted 6y ago[deleted]
- kragen 6y agoI haven't seen that usage anywhere.
- deleted 6y ago[deleted]
- gowld 6y agoSniffjoy is referring to static allocation of local variables on the stack (vs dynamically on the heap), not static allocation of the stack itself.
- kragen 6y agoReferring to stack allocation as "static allocation" is just not something I've seen before. I suspect you're simply in error; maybe you misheard someone saying the phrase "stack allocation", or you've been talking to somebody who misheard it that way. You can statically allocate a local variable in C, for example: static char *err = NULL; But that specifically does not allocate it on the stack. Both heap allocation and stack allocation are dynamic, not static. There are things that are a bit more of a gray area in C and Unix and Win32/64 — are "statically allocated" variables of a shared library really statically allocated if they aren't there when the program starts up and they may be at some unexpected address? — but this is not one of them.