RosettaCodeData/Task/Arena-storage-pool/Ada/arena-storage-pool-4.ada
2013-04-10 14:58:50 -07:00

15 lines
355 B
Ada

with Arena_Pools;
use Arena_Pools;
procedure Test_Allocator is
Pool : Arena_Pools.Arena (1024);
type Integer_Ptr is access Integer;
for Integer_Ptr'Storage_Pool use Pool;
X : Integer_Ptr := new Integer'(1);
Y : Integer_Ptr := new Integer'(2);
Z : Integer_Ptr;
begin
Z := new Integer;
Z.all := X.all + Y.all;
end Test_Allocator;