I have a little question mark regarding memory pointers and memory handlers.
Can anyone explain the difference between:

memH = MemHandleNew(10);
memP = MemHandleLock(memH);
// use memP
MemHandleUnlock(memH);
MemHandleResize(15);
MemHandleLock(memH);
// use it again
MemHandleUnlock(memH);
MemHandleFree(memH);

and

memP = MemPtrNew(10);
// use memP
MemPtrResize(15);
// use memP
MemPtrFree(memP);

?

Apart from the fact that the latter is easier and less error prone.
I suppose there's some limitations on the Pointer way, but can't seem to
find it. It seems, according to the docs, that I can do everything I could've
done with the Handle I could do with the Pointer... So what's the catch?

Also, what's 'MemPtrUnlock' good for? I can't seem to find the corresponding
'MemPtrLock' either. Is MemPtrUnlock for Pointers I've received from
MemHandleLock? If so, why is it there? If I no longer have the Handle I
can't see the use in Unlocking, and therefor losing, the Pointer...

Thanks in advance,
//Fredde



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

Reply via email to