mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: Heap improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@13447 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9afe778c22
commit
198bf2525c
1 changed files with 4 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue