mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
Do not set InOutRes if ReturnNilIfGrowHeapFails is set in SysOSAloc
git-svn-id: trunk@36255 -
This commit is contained in:
parent
751d47c568
commit
d46c8886de
@ -32,7 +32,12 @@ begin
|
||||
regs.ax:=$4800;
|
||||
nb_para:=size div 16;
|
||||
if nb_para > $ffff then
|
||||
result:=nil
|
||||
begin
|
||||
{$ifdef DEBUG_TINY_HEAP}
|
||||
writeln('SysOSAlloc size too big = ',size);
|
||||
{$endif}
|
||||
result:=nil;
|
||||
end
|
||||
else
|
||||
begin
|
||||
regs.bx:=nb_para;
|
||||
@ -42,8 +47,10 @@ begin
|
||||
{$ifdef DEBUG_TINY_HEAP}
|
||||
writeln('SysOSAlloc failed, err = ',regs.AX);
|
||||
{$endif}
|
||||
GetInOutRes(regs.AX);
|
||||
Result := nil;
|
||||
{ Do not set InOutRes if ReturnNilIfGrowHeapFails is set }
|
||||
if not ReturnNilIfGrowHeapFails then
|
||||
GetInOutRes(regs.AX);
|
||||
Result := nil;
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -54,6 +61,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
{$else not DATA_FAR}
|
||||
{$ifdef DEBUG_TINY_HEAP}
|
||||
writeln('SysOSAlloc cannot be used in small data models');
|
||||
{$endif}
|
||||
Result := nil;
|
||||
{$endif not DATA_FAR}
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user