From 214051e873d6189c88b18619d20d80942e2a359e Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Mon, 23 Mar 2026 20:36:24 +0100 Subject: [PATCH] Update pool tracking statistics when resizing big allocations table --- xtoskrnl/mm/alloc.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xtoskrnl/mm/alloc.cc b/xtoskrnl/mm/alloc.cc index 3e5c473..8821f05 100644 --- a/xtoskrnl/mm/alloc.cc +++ b/xtoskrnl/mm/alloc.cc @@ -606,6 +606,7 @@ MM::Allocator::ExpandBigAllocationsTable(VOID) PPOOL_TRACKING_BIG_ALLOCATIONS NewTable, OldTable; SIZE_T AllocationBytes, OldSize, NewSize; ULONG Hash, HashMask, Index; + PFN_NUMBER PagesFreed; XTSTATUS Status; BOOLEAN Abort; @@ -716,7 +717,11 @@ MM::Allocator::ExpandBigAllocationsTable(VOID) } /* Free memory allocated for the legacy table */ - FreePages(OldTable); + FreePages(OldTable, &PagesFreed); + + /* Update the pool tracking statistics */ + UnregisterAllocationTag(SIGNATURE32('M', 'M', 'g', 'r'), PagesFreed << MM_PAGE_SHIFT, (MMPOOL_TYPE)0); + RegisterAllocationTag(SIGNATURE32('M', 'M', 'g', 'r'), ROUND_UP(NewSize, MM_PAGE_SIZE), (MMPOOL_TYPE)0); /* Return success */ return TRUE; @@ -1553,8 +1558,8 @@ MM::Allocator::RegisterAllocationTag(IN ULONG Tag, * * @since XT 1.0 */ -BOOLEAN XTAPI +BOOLEAN MM::Allocator::RegisterBigAllocationTag(IN PVOID VirtualAddress, IN ULONG Tag, IN ULONG Pages,