I want to know what is the implementation of const and static const in palm
OS (local and global).
more presicely:
1. can globals appear on the code segment, or they have to appear in the
global data segment, even if they are declared as const/static const?
2. if I use local const, is it located in the call stack and initialized
every time I enter the routine, or maybe it is located in the code itself
and initialized only once?
I just have functions I use very frequently which access some const data. If
a local const is initialized on every entrance to the function, I waste
time. Also I don't want to use binary resources because of the same reason -
accessing records takes time. I'm writing a code resouce, so i can't use
globals which are not included within the code.
-----Original Message-----
From: Fitzpatrick, Joe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 30, 2000 8:38 PM
To: Palm Developer Forum
Subject: RE: attaching read-only vars to code
Are you doing this for security or are you trying to cut down on heap
usage? You can use assembly language to embed constants in your code
segment(s). You might also want to look at binary resources if you are
just trying to save on heap space.
As for #pragma's, whose tools are you using?
-jjf
-----Original Message-----
From: Oz Shalbar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 30, 2000 3:33 AM
To: Palm Developer Forum
Subject: attaching read-only vars to code
I have a read-only array which I use quite frequently, and I want to
include
it somehow in my code (not on the data section). I've tried to declare
it as
const or as static const, but I think it's sitting somewhere on the
global
data space. I want to know if there's some #pragma that controlls this,
and
some more information about const / static variables.
Thanx in advance.
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html