Category : Files from Magazines
Archive   : PJ63.ZIP
Filename : HEAP3
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.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/