Category : Files from Magazines
Archive   : PROGJRNL.ZIP
Filename : HEAP4
International. No commercial use of this code without express
permission from Borland International.
Run this one under TP4:
program Heap4; {$R-}
{ Compile and run under both Turbo Pascal 3.0 and 4.0.
Runs faster under 4.0.
}
const
ArraySize = 1000;
type
Byte3 = array[1..3] of Byte;
Byte5 = array[1..5] of Byte;
Byte7 = array[1..7] of Byte;
Byte9 = array[1..9] of Byte;
Ptr3 = ^Byte3;
Ptr5 = ^Byte5;
Ptr7 = ^Byte7;
Ptr9 = ^Byte9;
var
P5: array[1..ArraySize] of Ptr5;
P7: array[1..ArraySize] of Ptr7;
Q3: array[1..ArraySize] of Ptr3;
Q9: array[1..ArraySize] of Ptr9;
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(P7[I]);
end;
for I := ArraySize downto 1 do { fragmentation loop }
begin
Dispose(P5[I]);
New(Q3[I]);
New(Q9[I]);
Dispose(P7[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/