Parallel Programming Guide for HP-UX Systems

Memory classes
Memory class assignments
Chapter 7128
enclosed in slashes (/), and only entire COMMON blocks
can be assigned a class. This means arrays and
variables in
namelist
must not also appear in a
COMMON block and must not be equivalenced to data
objects in COMMON blocks.
where (for C)
storage_class_specifier
specifies a nonautomatic storage class
memory_class_name
is the desired memory class (thread_private,
node_private)
type_specifier
is a C or C++ data type (int, float, etc.)
namelist
is a comma-separated list of variables and/or arrays of
type
type_specifier
C and C++ data objects
In C and C++, data objects that are assigned a memory class must have
static storage duration. This means that if the object is declared within a
function, it must have the storage class extern or static. If such an
object is not given one of these storage classes, its storage class defaults
to automatic and it is allocated on the stack. Stack-based objects cannot
be assigned a memory class; attempting to do so results in a compile-time
error.
Data objects declared at file scope and assigned a memory class need not
specify a storage class.
All C and C++ code examples presented in this chapter assume that the
following line appears above the code presented:
#include <spp_prog_model.h>
This header file maps user symbols to the implementation reserved
space.
If operator new is used, it is also assumed that the line below appears
above the code:
#include <new.h>
If you assign a memory class to a C or C++ structure, all structure
members must be of the same class.
Once a data item is assigned a memory class, the class cannot be
changed.