Peter Epstein wrote in message <6923@palm-dev-forum>...
>
>You probably already know this, but MemHandleNew allows the memory manager
>to move that memory around if necessary to make room when asked for large
>chunks of contiguous memory. If you use MemPtrNew too much, you can end up
>with a fragmented heap in which there is plenty of free space, but none of
>the free areas are big enough to satisfy a request. Therefore, a good rule
>of thumb is to use MemPtrNew only for short-lived allocations.
>


Which begs the question: just what is "short lived"?

Somebody else suggested anything beyond the scope
of one routine deserves a handle instead of a pointer.

I have been considering that "the life of a form" might
be "short enough" to go for a ptr instead of a handle,
so I could avoid locking/unlocking in each method
associated w/ that form.

So ... what do you consider "short lived" enough to
get away w/ MemPtrNew instead of MemHandleNew?


--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!



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

Reply via email to