RosettaCodeData/Task/Memory-allocation/Ada/memory-allocation-3.ada
2023-07-01 13:44:08 -04: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;