A memory handle must be locked with MemHandleLock() before it is
accessed it should then be unlocked with MemHandleUnlock() when you are
not accessing it.  This allows the heap to be 'compacted' (blocks
relocated in memory).

If you just want to allocate and free within one function, you can use
MemPtrNew() and MemPtrFree() - which combine the handle and
locking/unlocking operations into single calls.

-jjf

-----Original Message-----
From: Alagesh [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 28, 2000 4:14 AM
To: Palm Developer Forum
Subject: Hoe to allocate memory


Hi All
I made use of MemHandleNew(size) to allocate memory of sizes 3k and 8k
approx. At the time of allocation it gives no error but during MemSet or
MemMove , any write operation on these allocated memory give rise to
error,
such as written/read directly to/from unallocated  chunk.
any one pl. tell me on how do I allocate this memory and make use of
them to
read and write.

TIA
Alagesh


--------------------------------------------------------------
Robosoft Technologies, Mangalore, India



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

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

Reply via email to