In article <com>,
Peter Seibel <com> wrote:
 
> >
> > It looks like NewPtr does some extra bookkeeping beyond just calling
> > malloc. If you disassemble NewPtr on Panther, you'll see that it calls
> > CSNewMemPtr, which validates the size that you pass it and calls both
> > malloc and malloc_size.[/ref]
>
> So does the extra work it does add some benefit? I.e. is there a
> reason to prefer either malloc or NewPtr, assuming one is writing only
> for OS X?[/ref]

You should prefer malloc on Mac OS X. It's the standard system
interface for allocating memory. NewPtr doesn't provide any extra
functionality, so there's no reason to use it in new code.

-Eric

--
Eric Albert stanford.edu
http://rescomp.stanford.edu/~ejalbert/