News for hackers. Stuff that matters.
Re:Chromium project finds that 70% of security defects are m... by fetbaffe on Sunday May 24, 2020 @06:22AM (#23290547)
Modern C++ means usage of reference counting (smart pointers), in some cases reference counting can be slower than a garbage collector.
Re:Chromium project finds that 70% of security defects are m... by bluGill on Sunday May 24, 2020 @08:18AM (#23290975)
In modern C++ the reference count is always 1 or 0 for 80% of the code and so there is no need to actually maintain the count. That other 15% needs a count which I agree is slower than gc done right. The final 5% has cycles and cannot be done by reference count.
Re:Chromium project finds that 70% of security defects are m... by dirtydroog on Sunday May 24, 2020 @09:20AM (#23291306)
Not really. Only shared_ptr uses ref counting, unique_ptr doesn't, and looking at our code base (highly networking orientated) we only use shared_ptr once. You could, in theory, use shared_ptr everywhere, but then you're not using the language properly and may as well resort to Java or similar.