Comment by Joker_vD
4 days ago
> There is no reason why the C/C++ stack can't grow up rather than down.
Historical accident. Imagine if PDP-7/PDP-11 easily allowed for the following memory layout:
FFFF +---------------+
| text | X
+---------------+
| rodata | R
+---------------+
| data + bss | RW
+---------------+
| heap |
| || | RW
| \/ |
+---------------+
| empty space | unmapped
+---------------+
| /\ |
| || | RW
| stack |
0000 +---------------+
Things could have turned out very differently than they have. Oh well.
Nice diagram. I might put read-only pages on both sides of 0 though to mitigate null pointer effects.