As far as I can see, using C++ classes, and specifically the <new> operator, automatically causes your application to use memory in a less flexible manner. So should I think twice before using classes in my application? Are nonmovable chunks really bad to use?
Classes are OK, but if your class stores a large amount of data, it is better to have the class hold handles, and have the class internally allocate a handle to the data on creation. Then, you'll only be MemPtrNew'ing a small amount of memory, and the larger chunk of memory will be in an unlocked handle for which the class will control access.
Also, non-movable chunks aren't as bad in Palm OS 3 and higher as they were before, and on current OS 5 devices, the heap space is large enough to allow a bit more flexibility. Also, allocating a handle and then leaving it locked for its entire life is considered worse than just allocating a pointer directly, as the OS expects that handles will generally be unlocked and movable.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
