package body System.Finalization_Primitives is
- use type System.Storage_Elements.Storage_Offset;
-
function To_Collection_Node_Ptr is
new Ada.Unchecked_Conversion (Address, Collection_Node_Ptr);
end if;
end Finalize_Object;
- ----------------------
- -- Header_Alignment --
- ----------------------
-
- function Header_Alignment return System.Storage_Elements.Storage_Count is
- begin
- return Collection_Node'Alignment;
- end Header_Alignment;
-
- -----------------
- -- Header_Size --
- -----------------
-
- function Header_Size return System.Storage_Elements.Storage_Count is
- begin
- return Collection_Node'Object_Size / Storage_Unit;
- end Header_Size;
-
----------------
-- Initialize --
----------------
package System.Finalization_Primitives with Preelaborate is
+ use type System.Storage_Elements.Storage_Offset;
+
type Finalize_Address_Ptr is access procedure (Obj : System.Address);
-- Values of this type denote finalization procedures associated with
-- objects that have controlled parts. For convenience, such objects
-- Calls to the procedure with an object that has already been detached
-- have no effects.
- function Header_Alignment return System.Storage_Elements.Storage_Count;
+ function Header_Alignment return System.Storage_Elements.Storage_Count is
+ (Collection_Node'Alignment);
-- Return the alignment of type Collection_Node as Storage_Count
- function Header_Size return System.Storage_Elements.Storage_Count;
+ function Header_Size return System.Storage_Elements.Storage_Count is
+ (Collection_Node'Object_Size / Storage_Unit);
-- Return the object size of type Collection_Node as Storage_Count
private