attribute_definition_clause ::= for local_name'attribute_designator use expression; | for local_name'attribute_designator use name;
Denotes the address of the first of the storage elements allocated to X. For a program unit or label, this value refers to the machine code associated with the corresponding body or statement. The value of this attribute is of type System.Address.
Address may be specified for stand-alone objects and for program units via an attribute_definition_clause.
NOTES
The Address of an object that is allocated under control of the implementation is an integral multiple of the Alignment of the object (that is, the Address modulo the Alignment is zero). The offset of a record component is a multiple of the Alignment of the component. For an object that is not allocated under control of the implementation (that is, one that is imported, that is allocated by a user-defined allocator, whose Address has been specified, or is designated by an access value returned by an instance of Unchecked_Conversion), the implementation may assume that the Address is an integral multiple of its Alignment. The implementation shall not assume a stricter alignment.
The value of this attribute is of type universal_integer, and nonnegative; zero means that the object is not necessarily aligned on a storage element boundary.
Alignment may be specified for first subtypes and stand-alone objects via an attribute_definition_clause; the expression of such a clause shall be static, and its value nonnegative. If the Alignment of a subtype is specified, then the Alignment of an object of the subtype is at least as strict, unless the object's Alignment is also specified. The Alignment of an object created by an allocator is that of the designated subtype.
If an Alignment is specified for a composite subtype or object, this Alignment shall be equal to the least common multiple of any specified Alignments of the subcomponent subtypes, or an integer multiple thereof.
NOTES
Denotes the size in bits of the representation of the object. The value of this attribute is of the type universal_integer.
If S is definite, denotes the size (in bits) that the implementation would choose for the following objects of subtype S:
NOTES
Denotes the number of storage elements reserved for the task. The value of this attribute is of the type universal_integer. The Storage_Size includes the size of the task's stack, if any. The language does not specify whether or not it includes other storage associated with the task (such as the ``task control block'' used by some implementations.) If a pragma Storage_Size is given, the value of the Storage_Size attribute is at least the value specified in the pragma.
pragma Storage_Size(expression);
Denotes the size in bits of components of the type of X. The value of this attribute is of type universal_integer.
S'External_Tag denotes an external string representation for S'Tag; it is of the predefined type String. External_Tag may be specified for a specific tagged type via an attribute_definition_clause; the expression of such a clause shall be static. The default external tag representation is implementation defined. See section 3.9.2 Dispatching Operations of Tagged Types, and See section 13.13.2 Stream-Oriented Attributes.
Byte : constant := 8; Page : constant := 2**12;
type Medium is range 0 .. 65_000; for Medium'Size use 2*Byte; for Medium'Alignment use 2; Device_Register : Medium; for Device_Register'Size use Medium'Size; for Device_Register'Address use System.Storage_Elements.To_Address(16#FFFF_0020#);
type Short is delta 0.01 range -100.0 .. 100.0; for Short'Size use 15;
for Car_Name'Storage_Size use -- specify access type's storage pool size 2000*((Car'Size/System.Storage_Unit) +1); -- approximately 2000 cars
function My_Read(Stream : access Ada.Streams.Root_Stream_Type'Class) return T; for T'Read use My_Read; -- See section 13.13.2 Stream-Oriented Attributes@NOTES
Go to the first, previous, next, last section, table of contents.