1) Is this the best way of work with large memory pointers on Palm? This
memory is allocated for all the time that process run (about 4 minutes), and
the emulator alert me that the memory should not be allocated for all this
time. So, if this isn't the correct way, which one is?

A 10K allocation shouldn't be a problem. I've never heard of POSE giving a warning about memory being allocated for too long, but I have heard of warnings due to the memory protection semaphore being reserved for too long. Are you receiving all the data with one call to NetLibDmReceive? If so, you might want to use a loop with a smaller buffer. If you're actually using the semaphore calls, stop doing that :)


2) I want to implement compression tecniques on my app, but, i know that
compress all the string at a time is better that compressing it pice by
pice. So, i think that i need to allocate a buffer that will contain all
compressed data received from server, pass this buffer to the ZLib library
and get the uncompressed data on another buffer. But, HOW CAN I ALLOCATE
THIS AMOUNT OF MEMORY, mainly on a device that have only 2Mb, like Palm Zire
and Palm M100???

Allocate the buffer using FtrPtrNew to allocate it in the storage heap, and use NetLibDmReceive to get data off the network into the buffer. Then, decompress it into either a heap-based buffer, or in pieces into a file stream database (FileOpen/FileWrite/FileClose).


-- Ben Combee, senior DTS engineer, PalmSource, Inc.
   Read "Combee on Palm OS" at http://palmos.combee.net/



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

Reply via email to