Browse Source

Kernel: Allocate more 8-byte slabs than anything else

We need these for PhysicalPage objects. Ultimately I'd like to get rid
of these objects entirely, but while we still have to deal with them,
let's at least handle large demand a bit better.
Andreas Kling 5 năm trước cách đây
mục cha
commit
d553bae749
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      Kernel/Heap/SlabAllocator.cpp

+ 4 - 3
Kernel/Heap/SlabAllocator.cpp

@@ -79,9 +79,10 @@ void for_each_allocator(Callback callback)
 
 
 void slab_alloc_init()
 void slab_alloc_init()
 {
 {
-    for_each_allocator([&](auto& allocator) {
-        allocator.init(128 * KB);
-    });
+    s_slab_allocator_8.init(384 * KB);
+    s_slab_allocator_16.init(128 * KB);
+    s_slab_allocator_32.init(128 * KB);
+    s_slab_allocator_48.init(128 * KB);
 }
 }
 
 
 void* slab_alloc(size_t slab_size)
 void* slab_alloc(size_t slab_size)