mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:38:11 +00:00
Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr
This commit is contained in:
parent
4e6f03a860
commit
6cf59b6ae9
58 changed files with 315 additions and 469 deletions
|
@ -443,9 +443,7 @@ PageFaultResponse AnonymousVMObject::handle_cow_fault(size_t page_index, Virtual
|
|||
auto& page_slot = physical_pages()[page_index];
|
||||
bool have_committed = m_shared_committed_cow_pages && is_nonvolatile(page_index);
|
||||
if (page_slot->ref_count() == 1) {
|
||||
#if PAGE_FAULT_DEBUG
|
||||
dbgln(" >> It's a COW page but nobody is sharing it anymore. Remap r/w");
|
||||
#endif
|
||||
dbgln_if(PAGE_FAULT_DEBUG, " >> It's a COW page but nobody is sharing it anymore. Remap r/w");
|
||||
set_should_cow(page_index, false);
|
||||
if (have_committed) {
|
||||
if (m_shared_committed_cow_pages->return_one())
|
||||
|
@ -456,14 +454,10 @@ PageFaultResponse AnonymousVMObject::handle_cow_fault(size_t page_index, Virtual
|
|||
|
||||
RefPtr<PhysicalPage> page;
|
||||
if (have_committed) {
|
||||
#if PAGE_FAULT_DEBUG
|
||||
dbgln(" >> It's a committed COW page and it's time to COW!");
|
||||
#endif
|
||||
dbgln_if(PAGE_FAULT_DEBUG, " >> It's a committed COW page and it's time to COW!");
|
||||
page = m_shared_committed_cow_pages->allocate_one();
|
||||
} else {
|
||||
#if PAGE_FAULT_DEBUG
|
||||
dbgln(" >> It's a COW page and it's time to COW!");
|
||||
#endif
|
||||
dbgln_if(PAGE_FAULT_DEBUG, " >> It's a COW page and it's time to COW!");
|
||||
page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::No);
|
||||
if (page.is_null()) {
|
||||
dmesgln("MM: handle_cow_fault was unable to allocate a physical page");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue