It depends on where you will use that. 

When you use a Handle, the memory chunck is moveable, I mean when the palmOS
need to (re)allocate memory for other porpouses it could move your handle to
satisfact its necessity. So, before you use it you must lock the handle...
and unlock just after using to let the PalmOS manager the memory
freely...When you see that you won´t use this handle anymore you free it
with memhandlefree.

The MemPtrNew simple allocates memory, the PalmOS will "forget" that chuncks
for this while (up to MemPtrFree) because it is yours!

So, you have to feel the best moment to use both. In my case, if I will keep
the allocated memory for a long time but not so usable I use the MemHandle
otherwise I prefer MemPtr.

Cheers

Ricardo

-----Mensagem original-----
De: Régis Daniel de Oliveira [mailto:[EMAIL PROTECTED]
Enviada em: terça-feira, 8 de junho de 2004 17:16
Para: Palm Developer Forum
Assunto: MemPtrNew versus MemHandleNew


Hy all!


My app need to allocate four 4k buffer, that will be used by many functions
during the app execution. I can allocate memory for the pointers using
MemPtrNew and MemHandleNew.

Witch one is the best for using?

Thanls all!



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

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

Reply via email to