If I remember correctly, some of the ROM apps have sample code where they do the whole 
MemSemaphoreReserve|Release() things and use MemMove...

In any case, it's really dangerous for your app to do that. DmWrite() essentially 
wraps MemMove() with bounds checking to ensure data integrity. There is somewhat of a 
performance hit depending on how it's used (for instance, lots of DmWrite's in a tight 
loop is much slower than lots of MemMove's in a tight loop) but in general it's not 
too bad of a hit. If you're buffering large amounts of data and need more than you can 
count on from the Dynamic heap, use a DmHandle, AND use DmWrite. Are you experiencing 
performance issues? If so, there are usually ways to improve performace, for instance, 
by doing multiple writes to a dynamic chunk and then buffering a larger block to the 
storate heap. This will decrease the overhead of having to go into DmWrite lots of 
times....

Alan Pinstein
Synergy Solutions, Inc.
http://www.synsolutions.com
1-800-210-5293
a BarPoint.com Company



> > Some of the SDK examples and the MemoPad tutorial edit a record
> > directly.  I've traced it a bit and DmWrite seems to be bypassed.  It
> > appears to me that the record handle is just being manipulated directly
> > using the memory manager.
>
>Could you post the examples that appear to contradict your understanding?
>Perhaps there's something specific there that we can explain to you.  For
>instance, most of the data in MemoPad is manipulated with Field Manager calls
>(like FldInsert), which call DmWrite for you.
>
>But in general, yes, DmWrite is required when modifying data in the storage
>heap, and no, you should not try to end-run it.
>
>-- Keith Rollin
>-- Palm OS Emulator engineer
>
>
>
>
>-- 
>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