At 12:26 PM 4/19/2005, you wrote:
Are you handling notifications through your mainline or through a callback function? If the latter, we lost almost a month trying to track down spurious errors until we realized our whole program was being moved when NVFS got full and this was invalidating callbacks we'd previously registered with PalmOS to handle notifications.

We couldn't find a recommended safe mechanism to lock down our own primary (0) code resource, so we ended up moving all the notification handlers in three of our programs either to launch code notifications (where possible) or to separate code resources that we could lock down manually to keep them from moving.

PalmSource, (Ben?) can you confirm this behavior or offer a better solution? Also, if PalmOS knows the addresses of all notification handlers that programs have registered, why doesn't it just automatically mark any memory blocks containing registered callbacks as non-movable in the DBCache?

I'm not at PalmSource anymore. See my signature.

Are you doing the two key things needed to lock a program?

1) Use DmGetResource and MemHandleLock to lock your resource in place
2) Use DmProtectDatabase to protect your program's database from being removed

The DBCache layer is separated from the Memory Manager layer, but DBCache does check the lock status of a block before removing it from the cache.

BTW, the 'code' #0 resource isn't your code. 'code' #1-#N are your code. 'code' #0 just contains a few data values used to determine the size of your global variable store.

-- Ben Combee, Senior Software Engineer, palmOne, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Developer Forum Archives:   http://news.palmos.com/read/all_forums/


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

Reply via email to