-- big_new.adb designed for 64 bit machine -- ref: big_malloc.c with Ada.Text_Io; use Ada.Text_Io; with Unchecked_Deallocation; procedure Big_New is type Matrix is array(Integer range <>, Integer range <>) of Long_Float; type Ptr is access Matrix; A : Ptr; N : Integer := 1000; procedure Free is new Unchecked_Deallocation(Matrix, Ptr); begin Put_Line("big_new.adb begins"); while N<40000 loop Put_Line("allocate "&Integer'Image(N)&" by "&Integer'Image(N)&" matrix"); A := new Matrix(1..N,1..N); for I in 1..N/100 loop for J in 1..N/100 loop A(100*I,100*J) := 0.0; end loop; end loop; Free(A); Put_Line("allocated and used "&Integer'Image(8*N*N)&" bytes"); New_Line; N := N+1000; end loop; Put_Line("big_new.adb ends"); end Big_New;