-
If the created object contains any tasks, they are activated,
See section 9.2 Task Execution - Task Activation. Finally, an access value that designates the created object
is returned.
NOTES
-
(24) Allocators cannot create objects of an abstract type. See section 3.9.3 Abstract Types and Subprograms.
-
(25) If any part of the created object is controlled, the initialization
includes calls on corresponding Initialize or Adjust procedures.
See section 7.6 User-Defined Assignment and Finalization.
-
(26) As explained in See section 13.11 Storage Management, the storage
for an object allocated by an allocator comes from a storage pool
(possibly user defined). The exception Storage_Error is raised by an
allocator if there is not enough storage. Instances of
Unchecked_Deallocation may be used to explicitly reclaim storage.
-
(27) Implementations are permitted, but not required, to provide garbage
collection, See section 13.11.3 Pragma Controlled.
Examples
-
Examples of allocators:
-
new Cell'(0, null, null)
-- initialized explicitly, See section 3.10.1 Incomplete Type Declarations
new Cell'(Value => 0, Succ => null, Pred => null)
-- initialized explicitly
new Cell
-- not initialized
-
new Matrix(1 .. 10, 1 .. 20)
-- the bounds only are given
new Matrix'(1 .. 10 => (1 .. 20 => 0.0))
-- initialized explicitly
-
new Buffer(100)
-- the discriminant only is given
new Buffer'(Size => 80, Pos => 0, Value => (1 .. 80 => 'A'))
-- initialized explicitly
-
Expr_Ptr'(new Literal)
-- allocator for access-to-class-wide type, See section 3.9.1 Type Extensions
Expr_Ptr'(new Literal'(Expression with 3.5))
-- initialized explicitly