home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
progjorn
/
pj_6_3.arc
/
HEAP3
< prev
next >
Wrap
Text File
|
1988-04-05
|
1KB
|
53 lines
Borland International's HEAP3. Copyright 1988 Borland
International. No commercial use of this code without express
permission from Borland International.
Run this program under TP3.
program Heap3; {$R-}
{ Compile and run under both Turbo Pascal 3.0 and 4.0.
Runs faster under 3.0.
}
const
ArraySize = 1000;
type
Byte5 = array[1..5] of Byte;
Byte9 = array[1..9] of Byte;
Ptr5 = ^Byte5;
Ptr9 = ^Byte9;
var
P5: array[1..ArraySize] of Ptr5;
P9: array[1..ArraySize] of Ptr9;
Q5: array[1..ArraySize] of Ptr5;
I: Integer;
Timer: Integer absolute $40:$6C;
Start: Integer;
begin
WriteLn('Start');
Start := Timer;
for I := 1 to ArraySize do { allocation loop }
begin
New(P5[I]);
New(P9[I]);
end;
for I := ArraySize downto 1 do { fragmentation loop }
begin
Dispose(P9[I]);
New(Q5[I]);
Dispose(P5[I]);
end;
Writeln('Done in ',(Timer-Start)/18.2:0:1,' seconds.');
end.