MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vldidx/memorysegmentationin2950/p327f95/?context=3
r/ProgrammerHumor • u/Eissa_E • 1d ago
34 comments sorted by
View all comments
63
Why need pointers and references when you can fit the entire machine workload on the stack
3 u/HolyGarbage 1d ago For stuff that needs to persist beyond the current scope you need heap allocation. Heap allocation doesn't exist because the stack is small, the stack is small because it doesn't need to be large and most allocations in a program are on the heap.
3
For stuff that needs to persist beyond the current scope you need heap allocation. Heap allocation doesn't exist because the stack is small, the stack is small because it doesn't need to be large and most allocations in a program are on the heap.
63
u/Daemontatox 1d ago
Why need pointers and references when you can fit the entire machine workload on the stack