VM: Pass a PhysicalPage by rvalue reference when returning it to the freelist.

This makes no functional difference, but it makes it clear that
MemoryManager and PhysicalRegion take over the actual physical
page represented by this PhysicalPage instance.
This commit is contained in:
Sergey Bugaev 2019-06-14 14:56:21 +03:00 committed by Andreas Kling
commit 118cb391dd
Notes: sideshowbarker 2024-07-19 13:36:55 +09:00
5 changed files with 12 additions and 12 deletions

View file

@ -23,7 +23,7 @@ PhysicalPage::PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_retu
{
}
void PhysicalPage::return_to_freelist()
void PhysicalPage::return_to_freelist() &&
{
ASSERT((paddr().get() & ~PAGE_MASK) == 0);
@ -32,9 +32,9 @@ void PhysicalPage::return_to_freelist()
m_retain_count = 1;
if (m_supervisor)
MM.deallocate_supervisor_physical_page(*this);
MM.deallocate_supervisor_physical_page(move(*this));
else
MM.deallocate_user_physical_page(*this);
MM.deallocate_user_physical_page(move(*this));
#ifdef MM_DEBUG
dbgprintf("MM: P%x released to freelist\n", m_paddr.get());