mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 12:37:44 +00:00
Kernel: Make PhysicalPage not movable and use atomic ref counting
We should not be moving ref-counted objects.
This commit is contained in:
parent
3320bb45d1
commit
08a569fbe0
5 changed files with 20 additions and 24 deletions
|
@ -42,18 +42,14 @@ PhysicalPage::PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_retu
|
|||
{
|
||||
}
|
||||
|
||||
void PhysicalPage::return_to_freelist() &&
|
||||
void PhysicalPage::return_to_freelist() const
|
||||
{
|
||||
ASSERT((paddr().get() & ~PAGE_MASK) == 0);
|
||||
|
||||
InterruptDisabler disabler;
|
||||
|
||||
m_ref_count = 1;
|
||||
|
||||
if (m_supervisor)
|
||||
MM.deallocate_supervisor_physical_page(move(*this));
|
||||
MM.deallocate_supervisor_physical_page(*this);
|
||||
else
|
||||
MM.deallocate_user_physical_page(move(*this));
|
||||
MM.deallocate_user_physical_page(*this);
|
||||
|
||||
#ifdef MM_DEBUG
|
||||
dbg() << "MM: P" << String::format("%x", m_paddr.get()) << " released to freelist";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue