added experimental stream handling code

This commit is contained in:
2013-12-28 16:52:31 +00:00
parent de981a1706
commit 3721e3c1a6
10 changed files with 575 additions and 111 deletions

View File

@ -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