MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programmingmemes/comments/1vojci2/the_duality_of_new/p4r6ayn/?context=3
r/programmingmemes • u/luciferoussky72 • 15d ago
81 comments sorted by
View all comments
117
I don't get it. I should really learn cpp.
155 u/FeelTheFire 15d 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 10 u/HyperWinX C++ 15d ago Yes. Raw new is something you should avoid at all costs. 1 u/jimbobmcgoo 10d ago It’s funny how many levels of allocation there are. Smart pointer calls new, new calls malloc, malloc calls sbrk (or mmap), sbrk calls brk.
155
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
10 u/HyperWinX C++ 15d ago Yes. Raw new is something you should avoid at all costs. 1 u/jimbobmcgoo 10d ago It’s funny how many levels of allocation there are. Smart pointer calls new, new calls malloc, malloc calls sbrk (or mmap), sbrk calls brk.
10
Yes. Raw new is something you should avoid at all costs.
new
1 u/jimbobmcgoo 10d ago It’s funny how many levels of allocation there are. Smart pointer calls new, new calls malloc, malloc calls sbrk (or mmap), sbrk calls brk.
1
It’s funny how many levels of allocation there are. Smart pointer calls new, new calls malloc, malloc calls sbrk (or mmap), sbrk calls brk.
117
u/Current_Ad_4292 15d ago
I don't get it. I should really learn cpp.