this post was submitted on 31 Aug 2025
324 points (96.6% liked)

Programmer Humor

26135 readers
1413 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
 

Finally I have a valid reason to learn about memory management. It was also hella weird when encountering it.

you are viewing a single comment's thread
view the rest of the comments
[–] resipsaloquitur@lemmy.world 1 points 2 days ago

The point of RAII is that a resource is allocated and freed in the same scope.

You can free it with an explicit call to a destructor, an implicit call, or with memory allocated on the stack, just wait for the stack frame to be exited.