mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 06:10:16 +02:00
* fixed growheap freelist addition when heapend-heapptr<blocksize
This commit is contained in:
parent
4d5712cc69
commit
c7d01df165
@ -463,15 +463,18 @@ begin
|
||||
else
|
||||
begin
|
||||
{ create freelist entry for old heapptr-heapend }
|
||||
pcurr:=pfreerecord(heapptr);
|
||||
pcurr^.size:=heapend-heapptr;
|
||||
pcurr^.root:=@freelists[0];
|
||||
{ insert the block in the freelist }
|
||||
pcurr^.next:=freelists[0];
|
||||
pcurr^.prev:=nil;
|
||||
if assigned(freelists[0]) then
|
||||
freelists[0]^.prev:=pcurr;
|
||||
freelists[0]:=pcurr;
|
||||
if heapend-heapptr>blocksize then
|
||||
begin
|
||||
pcurr:=pfreerecord(heapptr);
|
||||
pcurr^.size:=heapend-heapptr;
|
||||
pcurr^.root:=@freelists[0];
|
||||
{ insert the block in the freelist }
|
||||
pcurr^.next:=freelists[0];
|
||||
pcurr^.prev:=nil;
|
||||
if assigned(freelists[0]) then
|
||||
freelists[0]^.prev:=pcurr;
|
||||
freelists[0]:=pcurr;
|
||||
end;
|
||||
{ now set the new heapptr,heapend to the new block }
|
||||
heapptr:=pointer(newpos);
|
||||
heapend:=pointer(newpos+size);
|
||||
@ -503,7 +506,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.16 1999-09-17 17:14:12 peter
|
||||
Revision 1.17 1999-09-20 14:17:37 peter
|
||||
* fixed growheap freelist addition when heapend-heapptr<blocksize
|
||||
|
||||
Revision 1.16 1999/09/17 17:14:12 peter
|
||||
+ new heap manager supporting delphi freemem(pointer)
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user