* 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:
micha 2009-02-20 22:35:41 +00:00
parent 63419e3a2e
commit 82e9d9009d

View File

@ -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}