From 4fb00286d50dfcd1a373a920f2d4af644aefb030 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 22 Mar 2011 16:27:41 +0000 Subject: [PATCH] [RTL/HEAP] - Thomas Faber: Use macro instead of manually removing item from the list. See issue #6016 for more details. svn path=/trunk/; revision=51119 --- reactos/lib/rtl/heap.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/reactos/lib/rtl/heap.c b/reactos/lib/rtl/heap.c index 110e68b0993..59e1fa7d97f 100644 --- a/reactos/lib/rtl/heap.c +++ b/reactos/lib/rtl/heap.c @@ -341,18 +341,9 @@ RtlpRemoveFreeBlock(PHEAP Heap, BOOLEAN NoFill) { SIZE_T Result, RealSize; - PLIST_ENTRY OldBlink, OldFlink; - // FIXME: Maybe use RemoveEntryList? - - /* Remove the free block */ - OldFlink = FreeEntry->FreeList.Flink; - OldBlink = FreeEntry->FreeList.Blink; - OldBlink->Flink = OldFlink; - OldFlink->Blink = OldBlink; - - /* Update the freelists bitmap */ - if ((OldFlink == OldBlink) && + /* Remove the free block and update the freelists bitmap */ + if (RemoveEntryList(&FreeEntry->FreeList) && (Dedicated || (!Dedicated && FreeEntry->Size < HEAP_FREELISTS))) { RtlpClearFreeListsBit(Heap, FreeEntry);