"Dave Carrigan" <[EMAIL PROTECTED]> wrote in message
news:36009@palm-dev-forum...
>
> "Leandro Ferreira" <[EMAIL PROTECTED]> writes:
>
> > When I use MemPtrNew(), the OS could move this point on memory
> > defragmentation or is safe to the program make reference ALWAYS to that
> > address?
>
> MemPtrNew returns a locked memory pointer, which means it is impervious
> to defragmentation. Once it's locked, it remains locked (and potentially
> fragmenting the heap) for the life of the program.
Well, it no longer serves to fragment when its deleted, which means that
MemPtrNew-allocated memory works quite well for short-term objects, like
buffers that are allocated in a leaf functions, for example.
Also, with modern versions of Palm OS (3.0 and on), the MemHandleNew
allocations are done at the opposite end of the heap space from the
MemPtrNew allocations. This is good because it loweres the chance of Ptr
block fragmenting the handle space.
--
Ben Combee
Veriprise Wireless <http://www.veriprise.com>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/