Shared Libraries can not access an applications globals (via the a5
register), but can have 'global data'. When the library opens, it can
save a pointer with the system in the systems shared library tables.
This pointer is then available to all instances of that library. Create
a shared library project in CW to see how this works.

Shared libraries are limited to a single 64Kb code resource, and because
of the lack of proper globals have very limited support for c++ (no
v-tables, exceptions)

*everything* can have > 64k of globals if you program it right.

define all your globals as a structure; then allocate memory and store
the pointer in a feature. when you need globals; simply point your
globals "pointer" to the value within the feature.

palmos has feature tables for a good reason - use em.

the trick is to tweak the C++ compiler to use a globals structure
instead of native global objects for v-tables, exceptions etc. if someone
did this; it would solve a lot of problems, including the ability to run
native ARM programs written in C++ with exceptions!

just my 2c for lurking.

--
// Aaron Ardiri

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

Reply via email to