mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-09 18:19:46 +01:00
* check newpos < 0 instead of = -1
This commit is contained in:
parent
bf9add1688
commit
1ddaa693a3
@ -1146,7 +1146,7 @@ begin
|
|||||||
if size<=GrowHeapSize1 then
|
if size<=GrowHeapSize1 then
|
||||||
begin
|
begin
|
||||||
NewPos:=Sbrk(GrowHeapSize1);
|
NewPos:=Sbrk(GrowHeapSize1);
|
||||||
if NewPos<>-1 then
|
if NewPos>=0 then
|
||||||
size:=GrowHeapSize1;
|
size:=GrowHeapSize1;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1154,17 +1154,17 @@ begin
|
|||||||
if size<=GrowHeapSize2 then
|
if size<=GrowHeapSize2 then
|
||||||
begin
|
begin
|
||||||
NewPos:=Sbrk(GrowHeapSize2);
|
NewPos:=Sbrk(GrowHeapSize2);
|
||||||
if NewPos<>-1 then
|
if NewPos>=0 then
|
||||||
size:=GrowHeapSize2;
|
size:=GrowHeapSize2;
|
||||||
end
|
end
|
||||||
{ else alloate the needed bytes }
|
{ else alloate the needed bytes }
|
||||||
else
|
else
|
||||||
NewPos:=SBrk(size);
|
NewPos:=SBrk(size);
|
||||||
{ try again }
|
{ try again }
|
||||||
if NewPos=-1 then
|
if NewPos<0 then
|
||||||
begin
|
begin
|
||||||
NewPos:=Sbrk(size);
|
NewPos:=Sbrk(size);
|
||||||
if NewPos=-1 then
|
if NewPos<0 then
|
||||||
begin
|
begin
|
||||||
if ReturnNilIfGrowHeapFails then
|
if ReturnNilIfGrowHeapFails then
|
||||||
GrowHeap:=1
|
GrowHeap:=1
|
||||||
@ -1265,7 +1265,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.20 2003-05-01 08:05:23 florian
|
Revision 1.21 2003-05-23 14:53:48 peter
|
||||||
|
* check newpos < 0 instead of = -1
|
||||||
|
|
||||||
|
Revision 1.20 2003/05/01 08:05:23 florian
|
||||||
* started to make the rtl 64 bit save by introducing SizeInt and SizeUInt (similar to size_t of C)
|
* started to make the rtl 64 bit save by introducing SizeInt and SizeUInt (similar to size_t of C)
|
||||||
|
|
||||||
Revision 1.19 2002/11/01 17:38:04 peter
|
Revision 1.19 2002/11/01 17:38:04 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user