3 ms·
My rant on C++'s operator new (2006)
- throwawayaway 12y agoLike trying to shoehorn object orientation into C, often the cure is much worse than the disease - a truism which seems to apply here.
- astrange 12y ago> Though malloc is defined as part of the C language, it can be implemented as an ordinary library function requiring no special support from the compiler. This is actually not true, but happens by accident in most C implementations since they're being nice to you. C gives some functions like malloc() and pthread_mutex_lock() magic properties, but you can't write your own function from scratch that has those. As long as you don't try to optimize all that hard, or don't let the compiler try to inline your malloc, it won't go /that/ badly, but…
- dth 12y agoHa, interesting. Can you elaborate on what these "magic properties" of malloc() and pthread_mutex_lock() are? I'm curious.