Subj : Re: OO compilers and efficiency To : comp.programming From : Jon Harrop Date : Sun Jul 24 2005 08:59 pm Rob Thorpe wrote: > Yes, that's true, but malloc and free are generally very efficient. No, either or both of malloc and free are expensive. Which is cheap is not usually known to the programmer (usually malloc is cheaper). It is this not knowing that leads to inefficient code with manual allocation and deallocation via malloc and free. If you want to optimise your code then you should malloc a big block of memory and write your own customised memory allocation and deallocation routines. This is why malloc/new and free/delete are replaced by much faster, custom "allocators" in the C++ STL. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .