* growing is now 256k or 1mb

This commit is contained in:
peter 1999-05-31 20:36:34 +00:00
parent 20d56ae2a4
commit e161a3e489
2 changed files with 26 additions and 10 deletions

View File

@ -976,15 +976,24 @@ begin
wantedsize:=size;
{ Allocate by 64K size }
size:=(size+$fffff) and $ffff0000;
{ first try 1Meg }
if size<GrowHeapSize then
{ first try 256K (default) }
if size<GrowHeapSize1 then
begin
NewPos:=Sbrk(GrowHeapSize);
NewPos:=Sbrk(GrowHeapSize1);
if NewPos>0 then
size:=GrowHeapSize;
size:=GrowHeapSize1;
end
else
NewPos:=SBrk(size);
{ second try 1024K (default) }
if size<GrowHeapSize2 then
begin
NewPos:=Sbrk(GrowHeapSize2);
if NewPos>0 then
size:=GrowHeapSize2;
end
{ else alloate the needed bytes }
else
NewPos:=SBrk(size);
{ try again }
if NewPos=-1 then
begin
@ -1089,7 +1098,10 @@ end;
{
$Log$
Revision 1.10 1999-05-17 21:52:36 florian
Revision 1.11 1999-05-31 20:36:34 peter
* growing is now 256k or 1mb
Revision 1.10 1999/05/17 21:52:36 florian
* most of the Object Pascal stuff moved to the system unit
Revision 1.9 1999/04/19 11:53:13 pierre

View File

@ -30,8 +30,9 @@ Procedure SysFreemem(Var p:pointer;Size:Longint);
{ Variables }
const
heapblocks : boolean=true;
growheapsize : longint=$100000;
heapblocks : boolean=true;
growheapsize1 : longint=256*1024; { < 256k will grow with 256k }
growheapsize2 : longint=1024*1024; { > 256k will grow with 1m }
var
heaporg,heapptr,heapend,heaperror,freelist : pointer;
@ -57,14 +58,17 @@ Procedure releaseheap(oldfreelist,oldheapptr : pointer);
Procedure unsplit_heap;
Procedure switch_to_base_heap;
Procedure switch_to_temp_heap;
Procedure switch_heap;
Procedure switch_heap;
Procedure releasetempheap;
Procedure gettempmem(var p : pointer;size : longint);
{$endif TEMPHEAP}
{
$Log$
Revision 1.8 1999-02-08 09:31:40 florian
Revision 1.9 1999-05-31 20:36:35 peter
* growing is now 256k or 1mb
Revision 1.8 1999/02/08 09:31:40 florian
* fixed small things regarding TEMPHEAP
Revision 1.7 1998/10/01 14:55:18 peter