>if you need the memory
beyond the scope of one function/event-handler, use MemHandleNew and
then lock/unlock each use.  If the scope is limited to one
function/event-handler, use MemPtrNew.

This is probably the best scheme to follow.  It doesn't matter if a chunk is a
ptr and therefore unmovable for a long period of time as long as there isn't any
reason to move it.  Scope rules reflect that.

The memory manager works best if you follow a pattern of alloc1, alloc2, alloc3,
free3, free2, free1.

Handles are for when the lifetime of memory is ill defined with respect to other
allocations.  Leaving handles unlocked increases the ability to defragment when
necessary.


-Roger







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to