"Nesse, Rustin" <[EMAIL PROTECTED]> wrote in message
news:18645@palm-dev-forum...
> Overall, just keep each segment under 32k and minimize inter-segment
> jumps (calls to the other source files).

You do want to minimize inter-segment jumps, but inter-file jumps within a
segment aren't a problem. Having a separate .c file for each form is
probably a good idea. It'll let you fine-tune your segmentation. Code that's
used by launch codes that don't have access to globals needs to be in the
first segment, so be sure to split this code out into separate .c files.

You can exceed 32K per segment. I recommend using the Small code model in
CodeWarrior. As your segments gets bigger, it gets harder to arrange your
files within each segment to avoid long jumps. You can switch to the Smart
code model, but I recommend using more segments instead. The first segment
can be tricky though. If you have complex code for handling find or reset,
you may find this segment getting big.

If you index into an array of structs, you may find the CodeWarrior compiler
is using long math to do the index calculation. The startup code includes
the long math routines, and it's at the beginning of segment. So code like
this has to be in the first 32K or so. You can often eliminate the use of
long math by creating an arrays of pointers into the array of structs.
--
Danny Epstein
OS Engineer, Palm Inc.


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

Reply via email to