Core: Heap improvements

git-svn-id: svn://ultimatepp.org/upp/trunk@13447 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-06-27 07:39:35 +00:00
parent 9afe778c22
commit 198bf2525c

View file

@ -47,17 +47,10 @@ void *Heap::TryLAlloc(int i0, word wcount)
LBlkHeader *l = lheap.freelist[i];
LBlkHeader *h = l->next;
while(h != l) {
word sz = h->GetSize();
if(sz >= wcount) {
lheap.MakeAlloc(h, wcount);
h->heap = this;
return (BlkPrefix *)h + 1;
}
h = h->next;
RHITCOUNT("next");
static int q = 0;
if(++q < 1000)
RLOG(asString(sz) << " " << asString(wcount));
ASSERT(h->GetSize() >= wcount);
lheap.MakeAlloc(h, wcount);
h->heap = this;
return (BlkPrefix *)h + 1;
}
}
return NULL;