1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:47:46 +00:00

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
parent 7710e48d83
commit 118cb391dd
5 changed files with 12 additions and 12 deletions

View file

@ -23,7 +23,7 @@ public:
ASSERT(m_retain_count);
if (!--m_retain_count) {
if (m_may_return_to_freelist)
return_to_freelist();
move(*this).return_to_freelist();
else
delete this;
}
@ -38,7 +38,7 @@ private:
PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist = true);
~PhysicalPage() {}
void return_to_freelist();
void return_to_freelist() &&;
word m_retain_count { 1 };
bool m_may_return_to_freelist { true };