Prevent adding referenced pages to the free list
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 37s
Builds / ExectOS (amd64, debug) (push) Successful in 29s
Builds / ExectOS (i686, debug) (push) Successful in 28s
Builds / ExectOS (i686, release) (push) Successful in 34s

This commit is contained in:
2026-01-06 15:01:05 +01:00
parent bee91d0c71
commit b91c79e090
2 changed files with 15 additions and 10 deletions

View File

@@ -187,8 +187,13 @@ MM::Pfn::ProcessMemoryDescriptor(IN PFN_NUMBER BasePage,
/* Iterate over each page in this free memory run */
for(PageNumber = 0; PageNumber < PageCount; PageNumber++)
{
/* Add the page to the free list to make it available for allocation */
LinkFreePage(BasePage + PageNumber);
/* Get the PFN entry for the current page and ensure it is not referenced */
Pfn = GetPfnEntry(BasePage + PageNumber);
if(Pfn->u3.e2.ReferenceCount == 0)
{
/* Add the page to the free list to make it available for allocation */
LinkFreePage(BasePage + PageNumber);
}
}
}
else