Use of malloc() in v3

Stephen M. Webb stephen.webb@bregmasoft.com
Tue Nov 11 16:43:00 GMT 2003


I've been stumbling across several places in libstdc++ where malloc() is used 
instead of ::operator new().  Since I'm working on a platform that doesn't 
supply malloc(), this inconveniences me.

Is there any reason for choosing malloc() over of ::operator new()?  I can 
think of reasons to use ::operator new() over malloc() (namely, a single 
point of replacement for instrumentation or performance tweaking, and of 
course the unusual case of not having a malloc implementation).

I do have some patches locally that would change this.


-- 
Stephen M. Webb
stephen.webb@bregmasoft.com



More information about the Libstdc++ mailing list