Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,194 members, 7,953,697 topics. Date: Thursday, 19 September 2024 at 11:48 PM |
Nairaland Forum / Science/Technology / Programming / C++ Now Has Garbage Collection?! (721 Views)
Laravel:call To Undefined Method Illuminate\database\eloquent\collection::save() / Collection Of Nigerian Programming Gurus (2) (3) (4)
C++ Now Has Garbage Collection?! by asalimpo(m): 12:01am On Aug 30, 2014 |
Going thru explanation of smart pointers in a recent c++ book(c++11) and it all sounded like GC to me. If c++ uses gc wont tht mean tht modern c++ is going to b slower than its predecessors? 1 Like |
Re: C++ Now Has Garbage Collection?! by toshodei: 12:37am On Aug 30, 2014 |
asalimpo: Going thru explanation of smart pointers in a recent c++ book(c++11) and it all sounded like GC to me. I doubt it. 1 Like |
Re: C++ Now Has Garbage Collection?! by BlueMagnificent(m): 8:51pm On Aug 30, 2014 |
asalimpo: Going thru explanation of smart pointers in a recent c++ book(c++11) and it all sounded like GC to me. No, smart pointers implementation is not the same as garbage collector. Smart pointers are actually classes that act like pointers they internally keep pointer to the object they hold and a reference counter for the number of references to the object in the program code. When any of the smart pointers holding a reference to an object goes out of scope, the destructor decrements the counter, if the counter has a value of 0 the objects pointed to is deleted. So in effect there is no background object (GC) tasked with monitoring your program to know when an object is no longer referenced |
Re: C++ Now Has Garbage Collection?! by asalimpo(m): 11:23pm On Aug 30, 2014 |
BlueMagnificent:enlighteng. But for this reason, c++ with smartpointers is bound to b a bit slower for all d bacground wrk it's doing for d programmer. Not as slow though as full GC languages. |
Re: C++ Now Has Garbage Collection?! by BlueMagnificent(m): 12:06am On Aug 31, 2014 |
asalimpo: I won't really say slow cause the "smart operations" of a smart pointer introduce negligible performance hit |
(1) (Reply)
VB.NET Access Specifiers / 5 Tips To Improve Your Website / Help Needed On Complier
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |