User`s guide
Compiler Directives and Assertions [C]
#pragma no mem init
This directive affects only the declaration statement immediately
following the directive and tells the compiler not to specially
initialize the full/empty bit (or bits) of any sync- or future-qualified
variables defined in that declaration statement. The directive affects
only the definition of variables, including class instance variables; it
may not be used on field declarations inside classes. For example:
struct C
{/* note that a '#pragma mta no mem init'would be ineffective here */
sync int k;
};
main() {
#pragma mta no mem init
static C c;
/* use the pragma on the instance of the class rather
than on the class definition */
}
When the no mem init directive is not used, the compiler
initializes the full/empty bit of a sync-qualified variable to full if the
variable itself is initialized or to empty if the variable itself is not
initialized. When the no mem init directive is used immediately
before a declaration statement, the full/empty bits for any variables
defined in that declaration are initialized to full if the variable itself is
initialized. If the variable itself is not initialized, the initial state of
the full/empty bit is undefined (although, in practice, uninitialized
variables stored as static or global variables end up with their
full/empty bit initialized to full.) For example:
/* full-empty bit is set to full for a[0] and empty for a[1].*/
sync int a[2]={0};
#pragma mta no mem init
/*full-empty bit is set to full for b[0] and is undefined for b[1].*/
sync int b[2]={0};
main(){}
S–2479–20 119