mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 08:48:08 +02:00

also fail correctly rather than overflowing to 0 bytes (mantis #18690) git-svn-id: trunk@16877 -
18 lines
378 B
ObjectPascal
18 lines
378 B
ObjectPascal
Procedure AllocFreeGiB;
|
|
var
|
|
p: pointer;
|
|
RequestedSize: ptruint;
|
|
Begin
|
|
Writeln('-----------------------------');
|
|
RequestedSize:=high(ptruint); // n GiB - 1
|
|
Writeln('RequestedSize = ',RequestedSize,' bytes');
|
|
getmem(p,RequestedSize);
|
|
if (p<>nil) then
|
|
halt(1);
|
|
End;
|
|
|
|
Begin
|
|
ReturnNilIfGrowHeapFails:=true;
|
|
AllocFreeGiB;
|
|
End.
|