mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:14:25 +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;
|
regs.ax:=$4800;
|
||||||
nb_para:=size div 16;
|
nb_para:=size div 16;
|
||||||
if nb_para > $ffff then
|
if nb_para > $ffff then
|
||||||
result:=nil
|
begin
|
||||||
|
{$ifdef DEBUG_TINY_HEAP}
|
||||||
|
writeln('SysOSAlloc size too big = ',size);
|
||||||
|
{$endif}
|
||||||
|
result:=nil;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
regs.bx:=nb_para;
|
regs.bx:=nb_para;
|
||||||
@ -42,8 +47,10 @@ begin
|
|||||||
{$ifdef DEBUG_TINY_HEAP}
|
{$ifdef DEBUG_TINY_HEAP}
|
||||||
writeln('SysOSAlloc failed, err = ',regs.AX);
|
writeln('SysOSAlloc failed, err = ',regs.AX);
|
||||||
{$endif}
|
{$endif}
|
||||||
GetInOutRes(regs.AX);
|
{ Do not set InOutRes if ReturnNilIfGrowHeapFails is set }
|
||||||
Result := nil;
|
if not ReturnNilIfGrowHeapFails then
|
||||||
|
GetInOutRes(regs.AX);
|
||||||
|
Result := nil;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -54,6 +61,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$else not DATA_FAR}
|
{$else not DATA_FAR}
|
||||||
|
{$ifdef DEBUG_TINY_HEAP}
|
||||||
|
writeln('SysOSAlloc cannot be used in small data models');
|
||||||
|
{$endif}
|
||||||
Result := nil;
|
Result := nil;
|
||||||
{$endif not DATA_FAR}
|
{$endif not DATA_FAR}
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user