Sfoglia il codice sorgente

Kernel: Assert on OOM in Region::commit()

This function has a lot of callers that don't bother checking if it
returns successfully or not. We'll need to handle failure in a bunch
of places and then we can remove this assertion.
Andreas Kling 5 anni fa
parent
commit
c633c1c2ea
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      Kernel/VM/Region.cpp

+ 1 - 0
Kernel/VM/Region.cpp

@@ -137,6 +137,7 @@ bool Region::commit(size_t page_index)
     auto physical_page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::Yes);
     auto physical_page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::Yes);
     if (!physical_page) {
     if (!physical_page) {
         klog() << "MM: commit was unable to allocate a physical page";
         klog() << "MM: commit was unable to allocate a physical page";
+        ASSERT_NOT_REACHED();
         return false;
         return false;
     }
     }
     vmobject_physical_page_entry = move(physical_page);
     vmobject_physical_page_entry = move(physical_page);