320
the "good" parts (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] Dudewitbow@lemmy.zip 2 points 11 months ago* (last edited 11 months ago)

When you ever call new/malloc, its mandatory(dynamic allocation). For general programming, the size is usually decided at compilation.

Yes destructors will unallocate the memory, but the process of writing the destructor is part of the task of memory management

It becomes madness if you attempt to call dynamic memory outside of a class and its destructor, and hopefully the dev actually remembers to release said memory when their done.

this post was submitted on 21 Nov 2023
320 points (94.4% liked)

Programmer Humor

32410 readers
289 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS