At 07:44 PM 8/3/2004, you wrote:
Interesting, thanks!
Does that imply that the intersegment jumps include logic to lock the destination chunk and unlock the source chunk?
I was just assuming that all code sections were locked in memory while the app was executing. Did your warning pertain just to callbacks that hit after the app has closed, or do I need to be more careful with the section jumping?

The OS locks the main code resource (code 1), while the compiler's runtime code locks the other code resources and populates the jump table entries. These remain locked while the application is running; however, switching to another app will unlock all of those code sections, so leaving a callback in place can cause crashes.


Are you using CW expanded mode? If so, you need to create thunks for any callbacks to restore the A4 register correctly. This is described in the CW documentation.

Ah... there is one thing. If you're in code section 1, and you take the address of a routine in code section 2, you actually get the address of the jump table entry, not the address of the actual code in section 2. To get the code address, you need to call a function in section 2 to take the address of the section 2 function.

-- Ben Combee, DTS technical lead, PalmSource, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Palm OS Dev Fourm 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