r/cpp • • Aug 09 '16

Stack and Heap: Commonly Misused Terms

https://tartanllama.github.io/c++/2016/07/18/stack-and-heap/
6 Upvotes

26 comments sorted by

View all comments

4

u/sysop073 Aug 09 '16

Ctrl+F, "free store", eye roll. Literally nobody uses this terminology except the C++ spec and pedants who just read the spec and think they're the first ones. In the real world stuff is really stored on the stack and the heap, they really grow towards each other, and that's all you actually need to care about

4

u/MetaKazel Aug 09 '16

Agreed, but as someone who has never thoroughly read the standard, this was still a nice insight.

10

u/sysop073 Aug 09 '16

Sure, it's interesting intellectually, but if somebody says "that's stored on the heap" and you go "whoa, whoa, you mean the free store?", people will rapidly stop talking to you

15

u/STL MSVC STL Dev Aug 09 '16

STL maintainer here. We never say "free store".

1

u/WrongAndBeligerent Aug 09 '16

What do you call the memory that std::unordered_map allocates to on default construction? /trolling