13.11.3 Default Storage Pools
This paragraph was
The form of a pragma
Default_Storage_Pool is as follows:
storage_pool_indicator ::= storage_pool_name
Name Resolution Rules
is expected to be of type Root_Storage_Pool'Class.
shall denote a variable.
If the pragma
is used as a configuration pragma, the storage_pool_indicator
shall be null
, and it defines the default pool
to be null
within all applicable compilation units (see 10.1.5
except within the immediate scope of another pragma
Default_Storage_Pool. Otherwise, the pragma occurs immediately within
a sequence of declarations, and it defines the default pool within the
immediate scope of the pragma to be either null
or the pool denoted
by the storage_pool_name
except within the immediate scope of a later pragma Default_Storage_Pool.
Thus, an inner pragma overrides an outer one.
Default_Storage_Pool shall not be used as a configuration pragma that
applies to a compilation unit that is within the immediate scope of another
The language-defined aspect Default_Storage_Pool
may be specified for a generic instance; it defines the default pool
for access types within an instance.
The expected type for the Default_Storage_Pool aspect is Root_Storage_Pool'Class.
must be a name that denotes a variable. This aspect overrides any Default_Storage_Pool
pragma that might apply to the generic unit; if the aspect is not specified,
the default pool of the instance is that defined for the generic unit.
For nonderived access
types declared in places where the default pool is defined by the pragma
or aspect, their Storage_Pool or Storage_Size attribute is determined
as follows, unless Storage_Pool or Storage_Size is specified for the
If the default pool is null
, the Storage_Size
attribute is defined by the language to be zero. Therefore, an allocator
for such a type is illegal.
If the default pool is nonnull, the Storage_Pool
attribute is that pool.
Otherwise, there is no default pool; the standard
storage pool is used for the type as described in 13.11
This paragraph was
An object created by an allocator
that is passed as the actual parameter to an access parameter may be
allocated on the stack, and automatically reclaimed, regardless of the
32 Default_Storage_Pool may be used with
restrictions No_Coextensions and No_Access_Parameter_Allocators (see
) to ensure that all allocator
use the default pool.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe