Ada Reference ManualLegal Information
Contents   Index   References   Search   Previous   Next 

13.11.3 Default Storage Pools

This paragraph was deleted.


The form of a pragma Default_Storage_Pool is as follows: 
  pragma Default_Storage_Pool (storage_pool_indicator);
storage_pool_indicator ::= storage_pool_name | null
A pragma Default_Storage_Pool is allowed immediately within the visible part of a package_specification, immediately within a declarative_part, or as a configuration pragma. 

Name Resolution Rules

  The storage_pool_name is expected to be of type Root_Storage_Pool'Class. 

Legality Rules

The storage_pool_name 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.
  A pragma 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 pragma Default_Storage_Pool.

Static Semantics

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. The aspect_definition 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 type:
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 deleted.

Implementation Permissions

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 default pool.. 
32  Default_Storage_Pool may be used with restrictions No_Coextensions and No_Access_Parameter_Allocators (see H.4) to ensure that all allocators use the default pool. 

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe