The Horror in the Standard Library
Actually it is C's malloc and free that is "broken". malloc() takes a size parameter, but free() doesn't. This imbalance means it can never be maximally efficient. Whatever GNU stdlibc++ is doing is probably, on balance, a net win for most programs.<p>It's not exactly roses in C++ either of course. You can do better than the standard library facilities. Andrei Alexandrescu gave a great, entertaining, and technically elegant talk on memory allocation in C and C++ at Cppcon 2015 that is well worth watching<p><a href="https://www.youtube.com/watch?v=LIb3L4vKZ7U" rel="nofollow">https://www.youtube.com/watch?v=LIb3L4vKZ7U</a>