فهرست منبع

LibJS: Add dbgln() to Heap::allocator_for_size() before crashing

If we can't get a CellAllocator for the requested cell size, at least
print a debug message before dying.
Linus Groh 4 سال پیش
والد
کامیت
e7bfd34ea7
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      Userland/Libraries/LibJS/Heap/Heap.cpp

+ 1 - 0
Userland/Libraries/LibJS/Heap/Heap.cpp

@@ -47,6 +47,7 @@ ALWAYS_INLINE CellAllocator& Heap::allocator_for_size(size_t cell_size)
         if (allocator->cell_size() >= cell_size)
             return *allocator;
     }
+    dbgln("Cannot get CellAllocator for cell size {}, largest available is {}!", cell_size, m_allocators.last()->cell_size());
     VERIFY_NOT_REACHED();
 }