mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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:
parent
7710e48d83
commit
118cb391dd
Notes:
sideshowbarker
2024-07-19 13:36:55 +09:00
Author: https://github.com/bugaevc
Commit: 118cb391dd
Pull-request: https://github.com/SerenityOS/serenity/pull/229
5 changed files with 12 additions and 12 deletions
|
@ -458,7 +458,7 @@ RetainPtr<Region> MemoryManager::allocate_kernel_region(size_t size, String&& na
|
|||
return region;
|
||||
}
|
||||
|
||||
void MemoryManager::deallocate_user_physical_page(PhysicalPage& page)
|
||||
void MemoryManager::deallocate_user_physical_page(PhysicalPage&& page)
|
||||
{
|
||||
for (auto& region : m_user_physical_regions) {
|
||||
if (!region->contains(page)) {
|
||||
|
@ -468,7 +468,7 @@ void MemoryManager::deallocate_user_physical_page(PhysicalPage& page)
|
|||
continue;
|
||||
}
|
||||
|
||||
region->return_page(page);
|
||||
region->return_page(move(page));
|
||||
m_user_physical_pages_used--;
|
||||
|
||||
return;
|
||||
|
@ -515,7 +515,7 @@ RetainPtr<PhysicalPage> MemoryManager::allocate_user_physical_page(ShouldZeroFil
|
|||
return page;
|
||||
}
|
||||
|
||||
void MemoryManager::deallocate_supervisor_physical_page(PhysicalPage& page)
|
||||
void MemoryManager::deallocate_supervisor_physical_page(PhysicalPage&& page)
|
||||
{
|
||||
for (auto& region : m_super_physical_regions) {
|
||||
if (!region->contains(page)) {
|
||||
|
@ -525,7 +525,7 @@ void MemoryManager::deallocate_supervisor_physical_page(PhysicalPage& page)
|
|||
continue;
|
||||
}
|
||||
|
||||
region->return_page(page);
|
||||
region->return_page(move(page));
|
||||
m_super_physical_pages_used--;
|
||||
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue