How to resolve "Near data" more than 64k "problem on Palm using CodeWarrior9?

I am working on a large project and now I am facing the "Near data segment is more than 64k" error.

If I comment "FrmSetEventHandler (frm, DadosConstrutivos1HandleEvent); on the PrvAppHandleEvent in PilotMain the program will compile it. If I try to use the call, I get an error."

I am already using multi-segment and extended mode.

How do I resolve this?

Thanks to Rodrigo Leite Gomida

+1


source to share


2 answers


I don't use CodeWarrior, but use PocketStudio instead, and "the same problem" with me is a lot.

Each block is a "segment of code", so when your compiled block grows more than 64k of code, the compiler will warn you and not link your code.

Try to move the code from this device to another.

Or you can use #pragma:



#pragma segment Seg1

... code ...

#pragma segment Seg2

... code ...

      

Hello,

Christian.

0


source


There is no good way to solve this problem. The 68K on Palm OS can only access a small amount of static program data, as the 68K instruction set only provides an offset of + -32K for addressing data. This would require a significant compiler change to support further progress, as the compiler must generate code to perform complex pointer arithmetic, and neither CodeWarrior nor prc-tools support this.

Here are some tips:



  • If you have large data tables, try moving them to your own resources, where you will load and lock your location at runtime. This will take them out of the data section.
  • Turn on the compositing composer feature and see how the data section is allocated and see if there are any large data objects or arrays that you don't need.
  • Instead of declaring global variables, use global pointers to the memory you are allocating with MemGluePtrNew.
0


source







All Articles