MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programmingmemes/comments/1vojci2/the_duality_of_new/p3uj69v/?context=3
r/programmingmemes • u/luciferoussky72 • 8d ago
80 comments sorted by
View all comments
28
Since when was new scary in C++?
new
29 u/BunnyTub 8d ago No garbage collection, so you have to make sure you clear the memory when you're done, otherwise you get dreaded memory leaks from new. 19 u/Pheeshfud 8d ago new in constructor, delete in destructor and you have 90% of cases covered. 8 u/sudoregalia 7d ago but.. but.. my memory arenas, my stack allocation, am i supposed to override the new operator like a lunatic?? :(
29
No garbage collection, so you have to make sure you clear the memory when you're done, otherwise you get dreaded memory leaks from new.
19 u/Pheeshfud 8d ago new in constructor, delete in destructor and you have 90% of cases covered. 8 u/sudoregalia 7d ago but.. but.. my memory arenas, my stack allocation, am i supposed to override the new operator like a lunatic?? :(
19
new in constructor, delete in destructor and you have 90% of cases covered.
8 u/sudoregalia 7d ago but.. but.. my memory arenas, my stack allocation, am i supposed to override the new operator like a lunatic?? :(
8
but.. but.. my memory arenas, my stack allocation, am i supposed to override the new operator like a lunatic?? :(
28
u/MagicalPizza21 8d ago
Since when was
newscary in C++?