Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or you could use C++ and RAII. It's an excellent fit for the problem that's been presented.

Though I do understand, there are some very special projects that can't use C++, and must use C. I'd say in most cases, the extra machinery you get with C++ outweighs the small performance penalty you get by going with straight C.



FWIW, with C++, the advantages of linking to tcmalloc make it the default for any code that I write that isn't intended to run as a daemon -- and even there, unless I hit tcmalloc's limit of not releasing memory back, it's still a viable choice.


Google perftools are bloody awesomesauce.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: