added experimental stream handling code
This commit is contained in:
@ -28,30 +28,30 @@ package body H2.Pool is
|
||||
end if;
|
||||
end Allocate;
|
||||
|
||||
function Allocate (Source: in Normal_Type;
|
||||
Pool: in Storage_Pool_Pointer := null) return Pointer_Type is
|
||||
P: Storage_Pool_Pointer;
|
||||
begin
|
||||
if Pool = null then
|
||||
P := Storage_Pool;
|
||||
else
|
||||
P := Pool;
|
||||
end if;
|
||||
|
||||
if P = null then
|
||||
return new Normal_Type'(Source);
|
||||
else
|
||||
declare
|
||||
type Pooled_Pointer is access Normal_Type;
|
||||
for Pooled_Pointer'Storage_Pool use P.all;
|
||||
function To_Pointer_Type is new Ada.Unchecked_Conversion (Pooled_Pointer, Pointer_Type);
|
||||
Tmp: Pooled_Pointer;
|
||||
begin
|
||||
Tmp := new Normal_Type'(Source);
|
||||
return To_Pointer_Type (Tmp);
|
||||
end;
|
||||
end if;
|
||||
end Allocate;
|
||||
-- function Allocate (Source: in Normal_Type;
|
||||
-- Pool: in Storage_Pool_Pointer := null) return Pointer_Type is
|
||||
-- P: Storage_Pool_Pointer;
|
||||
-- begin
|
||||
-- if Pool = null then
|
||||
-- P := Storage_Pool;
|
||||
-- else
|
||||
-- P := Pool;
|
||||
-- end if;
|
||||
--
|
||||
-- if P = null then
|
||||
-- return new Normal_Type'(Source);
|
||||
-- else
|
||||
-- declare
|
||||
-- type Pooled_Pointer is access Normal_Type;
|
||||
-- for Pooled_Pointer'Storage_Pool use P.all;
|
||||
-- function To_Pointer_Type is new Ada.Unchecked_Conversion (Pooled_Pointer, Pointer_Type);
|
||||
-- Tmp: Pooled_Pointer;
|
||||
-- begin
|
||||
-- Tmp := new Normal_Type'(Source);
|
||||
-- return To_Pointer_Type (Tmp);
|
||||
-- end;
|
||||
-- end if;
|
||||
-- end Allocate;
|
||||
|
||||
procedure Deallocate (Target: in out Pointer_Type;
|
||||
Pool: in Storage_Pool_Pointer := null) is
|
||||
|
Reference in New Issue
Block a user