966
you are viewing a single comment's thread
view the rest of the comments
[-] tgm@lemmy.world 8 points 2 months ago

Haven't heard of the stack address thing, anyone got a TLDR on the topic?

[-] gnutrino@programming.dev 25 points 2 months ago* (last edited 2 months ago)

https://softwareengineering.stackexchange.com/questions/386194/why-do-we-still-grow-the-stack-backwards

TL;DR: For historical reasons stacks growing down is defined in hardware on some CPUs (notably x86). On other CPUs like some ARM chips for example you (or more likely your compiler's developer) can technically choose which direction stacks go but not conforming to the historical standard is the choice of a madman.

[-] Kidplayer_666@lemm.ee 8 points 2 months ago

Pretty sure that it’s something a long the lines of “stack begins high, grows down, while heap behind low grows high” when they meet, it’s a stack overflow

[-] shortrounddev@lemmy.world 5 points 2 months ago

They don't have to meet, the max stack size is defined at compile time

[-] rockSlayer@lemmy.world 1 points 2 months ago

Dynamic stacks are pretty common in the most popular scripting languages, but considered bad practice from folks who use systems languages

this post was submitted on 11 Feb 2025
966 points (96.5% liked)

Programmer Humor

22616 readers
1139 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS