mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 14:29:22 +02:00
* fix memory leak introduced in rev 9696, orphaned os chunks are not reused for short-lived threads (fixes issue #13173)
git-svn-id: trunk@12759 -
This commit is contained in:
parent
63419e3a2e
commit
82e9d9009d
@ -730,10 +730,11 @@ begin
|
||||
else
|
||||
maxsize := high(ptruint);
|
||||
poc:=nil;
|
||||
if (loc_freelists^.oscount>=MaxKeptOSChunks) then
|
||||
begin
|
||||
{ blocks available in freelist? }
|
||||
{ do not reformat fixed size chunks too quickly }
|
||||
if loc_freelists^.oscount >= MaxKeptOSChunks then
|
||||
poc := find_free_oschunk(loc_freelists, minsize, maxsize, size);
|
||||
{ if none available, try to recycle orphaned os chunks }
|
||||
if not assigned(poc) and (assigned(orphaned_freelists.waitfixed)
|
||||
or assigned(orphaned_freelists.waitvar) or (orphaned_freelists.oscount > 0)) then
|
||||
begin
|
||||
@ -763,7 +764,6 @@ begin
|
||||
end;
|
||||
leavecriticalsection(heap_lock);
|
||||
end;
|
||||
end;
|
||||
if poc = nil then
|
||||
begin
|
||||
{$ifdef DUMPGROW}
|
||||
|
Loading…
Reference in New Issue
Block a user