3 ms·
If you are programming to the level of abstraction of an ISO C or C++ program (or a higher-level language/abstraction), then the stack and heap are your primiti
by haberman 13y ago
If you are programming to the level of abstraction of an ISO C or C++ program (or a higher-level language/abstraction), then the stack and heap are your primitives and address spaces are an implementation detail.
If you are programming to the level of abstraction of POSIX, then address spaces are fundamental and the stack and heap are just convenience interfaces around mmap().
The fact that the StackOverflow question was asking for more OS-level details than the existing explanations they had found suggests that this is the time to provide actual implementation details instead of answering in more abstractions.
- derefr 13y agoI'm not talking about programming, I'm talking about computer science. A heap (really, an object reference digraph) is a mathematical object that you can prove theorems about. An address space is just one way to isolate a block of memory, a way to enforce on a Von Neumann architecture the preconditions that allow for that mathematical object to be instantiated and manipulated. Not every machine is an x86 with an MMU.
- blibble 13y agowas the question not about operating system implementations? I could condescendingly lecture people about blueberry ice cream, but that also wouldn't have any relevance to the topic at hand.
- deleted 13y ago[deleted]
- haberman 13y ago> A heap (really, an object reference digraph) is a mathematical object that you can prove theorems about. So is a Pseudo-Riemannian manifold. But neither of these is what the person was asking questions about. They were asking about programming on computers with operating systems.