> MemPtr ptr;
> MemHandle h = DmGetResource(...);
> if(h) ptr = MemHandleLock(h);
> if(ptr) {
> MemHandleUnlock(h);
> DmReleaseResource(h);
> }
>
> Now if I use ptr immediately, it seems ok. I got what I want. How safe is
it?
Poser will (rightly) complain if you do this. In practice, at least on older
versions of Palm OS, the chunk won't move as long as you don't call the
Memory Manager, directly or indirectly. I don't know if an interrupt handler
could use the Memory Manager; if so, this could be a problem. As others have
said, there's no point; just use the APIs as they were intended to be used.
A bug of this sort could keep you up all night!
--
Danny @ Palm
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/