RosettaCodeData/Task/Memory-allocation/Ada/memory-allocation-2.ada

7 lines
179 B
Ada
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
declare
type Integer_Ptr is access Integer;
Ptr : Integer_Ptr := new Integer; -- Allocated in the heap
begin
...
end; -- Memory is freed because Integer_Ptr is finalized