From 198bf2525c47a59e0d2bc2bd102a9799f0b67869 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 27 Jun 2019 07:39:35 +0000 Subject: [PATCH] Core: Heap improvements git-svn-id: svn://ultimatepp.org/upp/trunk@13447 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/lheap.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/uppsrc/Core/lheap.cpp b/uppsrc/Core/lheap.cpp index a8f1841eb..8db73f41d 100644 --- a/uppsrc/Core/lheap.cpp +++ b/uppsrc/Core/lheap.cpp @@ -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;