- Код: Выделить всё
program hangup;
uses sysutils;
type
spamarray = array [0..500000000] of byte; //A half-gig array of bytes
var
i: LongInt;
j: LongInt;
z: byte;
logfile: text;
fatmass: array [0..3] of spamarray;
procedure RefillSpamarray; //periodically we pull a spam blocks...
var
ii: byte;
zz: byte;
jj: LongInt;
begin
Writeln(logfile, DateTimeToStr(Now)+' STARTING REINITIALIZATION.');
Flush(logfile);
ii := Random(3);
zz := Random(255);
for jj := 0 to SizeOf(fatmass[ii]) do
begin
fatmass[ii][jj]:=zz;
end;
Writeln(logfile, DateTimeToStr(Now)+' Refilled block Nr '+IntToStr(ii)+ ' with value= '+
IntToStr(zz));
Flush(logfile);
end;
BEGIN
Assign(logfile, 'hangup.log');
Append(logfile);
Randomize;
for i := 0 to 3 do begin //fill four half-gig arrays with rand. databyte
z := Random(255);
for j := 0 to (SizeOf(fatmass[i])-1) do
begin
fatmass[i][j]:=z;
end;
Writeln(logfile, DateTimeToStr(Now)+' Block Nr '+IntToStr(i)+ ' initialized with value= '+
IntToStr(z));
Flush(logfile);
end;
i:=1;
z:=1;
while i <> 0 do
begin
z:= z * i;
if i = 2147483647 then
begin
RefillSpamarray;
i := 1;
end;
Inc(i);
end;
END.
Успешно компилится и запускается под Linux (kernel 3.2.0)
Однако под виндами (пробовал Xp и Win7 (x32)) выдает:
