At 11:29 AM 6/23/2004, you wrote:
Which is the difference between

MemPtr Pointer=MemPtrNew(30*1024);

And

char *Pointer=new char[30*1024];

First, you should write 30*1024L to avoid overflowing a Int16.

Second, the big difference is that the allocation using operator new[] stores a small amount of additional info so that operator delete[] knows how large the allocation was to properly deallocate it. The actual implementation of operator new[]/operator delete[] use MemPtrNew and MemPtrFree.


-- Ben Combee, DTS technical lead, PalmSource, Inc. Read "Combee on Palm OS" at http://palmos.combee.net/


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to