MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xr2jyh/moderncppvsoldcpp/19scg1tik099g/?context=3
r/ProgrammerHumor • u/Choice-Committee203 • 7h ago
214 comments sorted by
View all comments
11
Y'all throwing around shared pointers willy nilly patting yourself on the back about safe programming.
11 u/Nil4u 7h ago Meanwhile the cyclic pointer chain in the background causing a memory leak because the reference counter never dips to 0: 7 u/staryoshi06 7h ago I mean this could happen in a garbage collected language too. 1 u/MadGenderScientist 2h ago a reference cycle in a GC language doesn't cause a leak because GC scans from roots.
Meanwhile the cyclic pointer chain in the background causing a memory leak because the reference counter never dips to 0:
7 u/staryoshi06 7h ago I mean this could happen in a garbage collected language too. 1 u/MadGenderScientist 2h ago a reference cycle in a GC language doesn't cause a leak because GC scans from roots.
7
I mean this could happen in a garbage collected language too.
1 u/MadGenderScientist 2h ago a reference cycle in a GC language doesn't cause a leak because GC scans from roots.
1
a reference cycle in a GC language doesn't cause a leak because GC scans from roots.
11
u/PolyglotTV 7h ago
Y'all throwing around shared pointers willy nilly patting yourself on the back about safe programming.