At 10:15 AM +1000 8/11/03, Alan Ingleby wrote:
"Todd Niec" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 Is it possible to use DmWrite() on ordinary memory?  I have cases where
 buffers might be stored in "ordinary" memory (stack, heap, or static
 globals) or might be in a record in a file and I would like 1 method
 to write to both of them.

Try it and see. My suspicion is that is will probably fail, as DmWrite is designed to stop you from writing to the wrong place etc, but you never know...

Ugh, I can't believe that advice just crossed this forum! Using that logic, if I rob a house and don't get caught, it must be OK. :-)


See a posting I made to news://news.falch.net/pilot.programmer.gcc, 2003-03-06, "Re: Better ways to update a field" (sadly, it doesn't show up on a Google search). It's about DmStrCopy vs. StrCopy, but the same advice applies to DmWrite vs. MemMove.

Why can't you just keep track of the type of memory yourself, then use the
appropriate DmWrite or MemMove calls? Even if DmWrite happens to work, it is
always going to be slower than MemMove...

Now, *this* is advice I like! To it, I should add "Even if using DmWrite works on non-storage heap memory now, there's nothing that says it won't in the future".


-- Keith Rollin
-- Palm OS Emulator engineer

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

Reply via email to