▲ 321 ▼ the "good" parts (lemmy.world) submitted 2 years ago by hairinmybellybutt@lemmy.world to c/programmerhumor@lemmy.ml 20 comments fedilink hide all child comments
[+] Hazzia@discuss.tchncs.de 1 point 2 years ago* (last edited 2 years ago) (1 child) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] Dudewitbow@lemmy.zip 2 points 2 years ago* (last edited 2 years 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. permalink fedilink source parent
[–] Dudewitbow@lemmy.zip 2 points 2 years ago* (last edited 2 years 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. permalink fedilink source parent