Core: TryRealloc improvement

git-svn-id: svn://ultimatepp.org/upp/trunk@8101 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-01-26 19:26:41 +00:00
parent 6194385b7e
commit 0c05d4e179

View file

@ -265,6 +265,8 @@ bool Heap::LTryRealloc(void *ptr, size_t newsize)
}
if(bh->heap != this) // if another thread's heap, do not bother to be smart
return newsize <= bh->size;
if(bh->size >= newsize)
return true;
LLOG("--- TryRealloc " << asString(bh->size));
Header *n = bh->Next();
if(n->free && newsize <= (size_t)n->size + (size_t)bh->size) {