RosettaCodeData/Task/Memory-allocation/Ada/memory-allocation-3.ada
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

8 lines
242 B
Ada

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;