Sfoglia il codice sorgente

LibJS: Add inline capacity to BlockAllocator's blocks Vector

There's no need to dynamically allocate a constant sized vector :^)
Idan Horowitz 4 anni fa
parent
commit
ffaf27e4b6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      Userland/Libraries/LibJS/Heap/BlockAllocator.h

+ 1 - 1
Userland/Libraries/LibJS/Heap/BlockAllocator.h

@@ -22,7 +22,7 @@ public:
 private:
     static constexpr size_t max_cached_blocks = 64;
 
-    Vector<void*> m_blocks;
+    Vector<void*, max_cached_blocks> m_blocks;
 };
 
 }