hcl/lib2/h3-pool.ads

28 lines
947 B
Ada
Raw Normal View History

2021-08-23 23:47:29 +00:00
--------------------------------------------------------------------
-- Instantantiate this package before using. To allocate integers,
--
-- type Integer_Pointer is access Integer_Pointer;
-- package Integer_Pool is new Pool(Integer, Integer_Pointer, Storage_Pool'Unchecked_Access);
-- x: Integer_Pointer;
--
-- x := Integer_Pool.Allocate(10);
--------------------------------------------------------------------
generic
type Normal_Type is private;
type Pointer_Type is access Normal_Type;
Storage_Pool: in Storage_Pool_Pointer := null;
package H3.Pool is
--pragma Preelaborate (Pool);
function Allocate (Pool: in Storage_Pool_Pointer := null) return Pointer_Type;
function Allocate (Source: in Normal_Type;
Pool: in Storage_Pool_Pointer := null) return Pointer_Type;
procedure Deallocate (Target: in out Pointer_Type;
Pool: in Storage_Pool_Pointer := null);
end H3.Pool;