News for hackers. Stuff that matters.
Re:Why are most browsers developed in C++? by munificent on Wednesday July 31, 2013 @02:14PM (#6135733)
Object pools: they allocate objects upfront and re-use instances instead of creating and releasing them.
Re:Why are most browsers developed in C++? by Arelius on Wednesday July 31, 2013 @02:17PM (#6135759)
This is one trick, among many. Most of which negate many of the advantages of GC in the first place.
Re:Why are most browsers developed in C++? by zurn on Wednesday July 31, 2013 @03:16PM (#6136180)
The advantages of memory-safety remain.
Re:Why are most browsers developed in C++? by pcwalton on Wednesday July 31, 2013 @04:35PM (#6136663)
Some advantages of memory safety remain. When using pools, you don't get protection against use-after-free or leaks. It does somewhat mitigate the consequences of those, however: it's much harder for a use-after-free to become a security exploit in a pool in a GC'd language, for example.
Re:Why are most browsers developed in C++? by zurn on Tuesday August 06, 2013 @05:20AM (#6165598)
Sounds like you have a specific kind of object pool implementation in mind? Invalid object refs don't have to break the memory safety, cf. weakrefs.

An object pool can also be implemented without unsafe bulding blocks or other language support, as a pool of objects that are manually recycled after the pool lifetime is up. Then a bug could let you confuse a previous generation object witha current-gen one, but would not break memory-safety either.