Jimi Malcolm <[EMAIL PROTECTED]> wrote in message
news:54295@palm-dev-forum...
>
> I just rewrite it using handles which I un/lock to get pointers which I
use.
> Now it all works!  I'd still appreciate some explaination as to why it was
> giving me such a hard time.  The Palm OS Companion says MemHandles can be
> expanded once unlocked whereas MemPtrs have a harder time when expanded.


The difference between pointers and handles is that pointers refer directly
to a chunk of memory, while handles refer to a pointer which in turn refers
directly to a chunk of memory.  This means that handles give you a layer of
indirection.  The layer allows the chunk to be moved without your handle
becoming invalid (only the pointer needs to updated).  That's why
MemPtrResize fails even if there is more memory available (if you only have
a pointer to a chunk you can't move it transparently) while MemHandleResize
can move the chunk to a clear area of memory.

There's a document called "Palm OS Memory Architecture" you may want to read
(see http://oasis.palm.com/dev/kb/papers/1145.cfm It's for OS 3.0, but it's
the most up to date I've found).

I hope that helps you.

Luca


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

Reply via email to