From: "Pj" <[EMAIL PROTECTED]> > I'm getting the "chunk over-locked" error very occasionaly, > I'm trying to find out where I forgot to unlock a chunk, all I know, at the moment, is that it's > probably in the bitmap-loading routine. Are there any other reasons why this error could happen? > Also, is it possible to simply call a routine that unlocks all chunks? > Although there's a little work to it, it can be worth writing a debug wrapper for the mem functions that take note of chunk details as the allocation and deallocation occurs. This provides excellent data on locking behaviours.
I think I posted some code to do this years ago, but the basic idea is to create your own, for example, DmMemHandleUnlock function that logs the chunk details to a debug info port and then calls MemHandleUnlock. While debugging you include a header that #defines MemHandleUnlock DmMemHandleUnlock and voila, you'll get a stream of data with all unlocks. I used a comma delimited id, size, first bytes, lock count, etc format and dumped it into a db for analysis. With this data you can easily see function call patterns as lock counts increase and decrease and it's fairly easy from this to pick out locks that aren't coming back to zero. Write it once, use it forever. Of course it's possible that some of the new CW tools will provide this info - any comment from the better-informed? Chris Tutty -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
