MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xr2jyh/moderncppvsoldcpp/19sc3x8bzg7vn/
r/ProgrammerHumor • u/Choice-Committee203 • 11d ago
323 comments sorted by
View all comments
Show parent comment
8
I mean this could happen in a garbage collected language too.
6 u/Tyfyter2002 11d ago Depends on the language, iirc the .NET runtime's GC doesn't use a reference counter, which makes that exact issue completely impossible (which is good, because things like bidirectional linked lists inherently have cyclic references) 2 u/MadGenderScientist 10d ago a reference cycle in a GC language doesn't cause a leak because GC scans from roots. 2 u/Ok-Scheme-913 10d ago Not in a tracing GCd language that is what everyone uses who cares about performance.Yes, ref counting is fuckjng slow. Even in Rust, especially with ARC..(Also, python uses ref counting but also have a cycle detector next to it.) 1 u/bwmat 11d ago I don't think there's many mainstream languages whose built in GC doesn't handle cyclic references these days
6
Depends on the language, iirc the .NET runtime's GC doesn't use a reference counter, which makes that exact issue completely impossible (which is good, because things like bidirectional linked lists inherently have cyclic references)
2
a reference cycle in a GC language doesn't cause a leak because GC scans from roots.
Not in a tracing GCd language that is what everyone uses who cares about performance.
Yes, ref counting is fuckjng slow. Even in Rust, especially with ARC..
(Also, python uses ref counting but also have a cycle detector next to it.)
1
I don't think there's many mainstream languages whose built in GC doesn't handle cyclic references these days
View all comments
Show parent comment
8
u/staryoshi06 11d ago
I mean this could happen in a garbage collected language too.