浏览代码

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();
 }