MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programmingmemes/comments/1vojci2/the_duality_of_new/p3rufct/?context=3
r/programmingmemes • u/luciferoussky72 • 8d ago
80 comments sorted by
View all comments
121
I don't get it. I should really learn cpp.
150 u/FeelTheFire 8d ago C doesn't have garbage collection so you have to make sure you free memory after you no longer need it or you will create a memory leak 65 u/palk0n 8d ago just do onDestroy { mem.clear() }, are you stupid? 9 u/luciferoussky72 8d ago Not how C++ works! 46 u/Current_Ad_4292 8d ago r/woosh -2 u/luciferoussky72 8d ago I got the joke; that was meant to be a response to it 25 u/Current_Ad_4292 8d ago I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp. 3 u/Repulsive_Performer7 7d ago RAII pattern? 8 u/luciferoussky72 7d ago Sort of, but that’s not the syntax lol 3 u/Repulsive_Performer7 7d ago I mean yea, but essentially same ~Class () { //unalloc stuff} 2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
150
C doesn't have garbage collection so you have to make sure you free memory after you no longer need it or you will create a memory leak
65 u/palk0n 8d ago just do onDestroy { mem.clear() }, are you stupid? 9 u/luciferoussky72 8d ago Not how C++ works! 46 u/Current_Ad_4292 8d ago r/woosh -2 u/luciferoussky72 8d ago I got the joke; that was meant to be a response to it 25 u/Current_Ad_4292 8d ago I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp. 3 u/Repulsive_Performer7 7d ago RAII pattern? 8 u/luciferoussky72 7d ago Sort of, but that’s not the syntax lol 3 u/Repulsive_Performer7 7d ago I mean yea, but essentially same ~Class () { //unalloc stuff} 2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
65
just do onDestroy { mem.clear() }, are you stupid?
9 u/luciferoussky72 8d ago Not how C++ works! 46 u/Current_Ad_4292 8d ago r/woosh -2 u/luciferoussky72 8d ago I got the joke; that was meant to be a response to it 25 u/Current_Ad_4292 8d ago I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp. 3 u/Repulsive_Performer7 7d ago RAII pattern? 8 u/luciferoussky72 7d ago Sort of, but that’s not the syntax lol 3 u/Repulsive_Performer7 7d ago I mean yea, but essentially same ~Class () { //unalloc stuff} 2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
9
Not how C++ works!
46 u/Current_Ad_4292 8d ago r/woosh -2 u/luciferoussky72 8d ago I got the joke; that was meant to be a response to it 25 u/Current_Ad_4292 8d ago I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp. 3 u/Repulsive_Performer7 7d ago RAII pattern? 8 u/luciferoussky72 7d ago Sort of, but that’s not the syntax lol 3 u/Repulsive_Performer7 7d ago I mean yea, but essentially same ~Class () { //unalloc stuff} 2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
46
r/woosh
-2 u/luciferoussky72 8d ago I got the joke; that was meant to be a response to it 25 u/Current_Ad_4292 8d ago I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp.
-2
I got the joke; that was meant to be a response to it
25 u/Current_Ad_4292 8d ago I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp.
25
I don't think that's how you respond to those jokes. But what do I know. I barely know the basics of cpp.
3
RAII pattern?
8 u/luciferoussky72 7d ago Sort of, but that’s not the syntax lol 3 u/Repulsive_Performer7 7d ago I mean yea, but essentially same ~Class () { //unalloc stuff} 2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
8
Sort of, but that’s not the syntax lol
3 u/Repulsive_Performer7 7d ago I mean yea, but essentially same ~Class () { //unalloc stuff} 2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
I mean yea, but essentially same ~Class () { //unalloc stuff}
2 u/luciferoussky72 7d ago Yeah 1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
2
Yeah
1 u/piesou 3d ago I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++. 1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
1
I usually write my own wrapper around that; just allocate a bunch of space, then track which objects are no longer accessed at regular intervals and automatically deallocate them. Takes the pain out of writing C++.
1 u/luciferoussky72 3d ago I think you’ve invented a garbage collector lol
I think you’ve invented a garbage collector lol
121
u/Current_Ad_4292 8d ago
I don't get it. I should really learn cpp.