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

9 lines
242 B
Ada
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
declare
type Integer_Ptr is access Integer;
procedure Free is new Ada.Unchecked_Deallocation (Integer, Integer_Ptr)
Ptr : Integer_Ptr := new Integer; -- Allocated in the heap
begin
Free (Ptr); -- Explicit deallocation
...
end;