_iss char * stackMemory;
_iss sqInt theUnknownShort;
#undef _iss
#if SQ_USE_GLOBAL_STRUCT
} fum;
# define DECL_MAYBE_SQ_GLOBAL_STRUCT register struct foo * foo = &fum;
# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT volatile register struct foo * foo = &fum;
# define GIV(interpreterInstVar) (foo->interpreterInstVar)
#else
# define DECL_MAYBE_SQ_GLOBAL_STRUCT /* oh, no mr bill! */
# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT /* oh no, mr bill! */
# define GIV(interpreterInstVar) interpreterInstVar
#endif
#if SQ_USE_GLOBAL_STRUCT
static struct foo * foo = &fum;
#endif
and then a function that uses global variables looks like
EXPORT(sqInt)
addGCRoot(sqInt *varLoc) {
DECL_MAYBE_SQ_GLOBAL_STRUCT
if (GIV(extraRootCount) >= ExtraRootSize) {
return 0;
}
GIV(extraRoots)[GIV(extraRootCount) += 1] = varLoc;
return 1;
}
And for us whether to use the global struct or not on Mac OS depends on whether we're using the Intel compiler or gcc. The Intel compiler produces an interpreter (not a JIT) that is 10% faster if it uses the global struct, whereas gcc produces one that is slightly slower. So making the choice depend on platform is a mistake anyway. It depends on platform and compiler.