mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +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");
|
||||
|
|
|
@ -457,9 +457,7 @@ PageFaultResponse Region::handle_zero_fault(size_t page_index_in_region)
|
|||
auto page_index_in_vmobject = translate_to_vmobject_page(page_index_in_region);
|
||||
|
||||
if (!page_slot.is_null() && !page_slot->is_shared_zero_page() && !page_slot->is_lazy_committed_page()) {
|
||||
#if PAGE_FAULT_DEBUG
|
||||
dbgln("MM: zero_page() but page already present. Fine with me!");
|
||||
#endif
|
||||
dbgln_if(PAGE_FAULT_DEBUG, "MM: zero_page() but page already present. Fine with me!");
|
||||
if (!remap_vmobject_page(page_index_in_vmobject))
|
||||
return PageFaultResponse::OutOfMemory;
|
||||
return PageFaultResponse::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue