From d560ee118d0d253972770a06af99512723db9be1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 10 Jun 2021 17:39:35 +0200 Subject: [PATCH] LibJS: Allocate 4 KiB for Bytecode::BasicBlock There's no reason not to, since we're using mmap() for these anyway and that gives us memory in 4 KiB increments. :^) --- Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp b/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp index a0a15903ed..b4901da98f 100644 --- a/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp +++ b/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp @@ -22,7 +22,7 @@ BasicBlock::BasicBlock(String name) // FIXME: This is not the smartest solution ever. Find something cleverer! // The main issue we're working around here is that we don't want pointers into the bytecode stream to become invalidated // during code generation due to dynamic buffer resizing. Otherwise we could just use a Vector. - m_buffer_capacity = 1 * KiB; + m_buffer_capacity = 4 * KiB; m_buffer = (u8*)mmap(nullptr, m_buffer_capacity, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); VERIFY(m_buffer != MAP_FAILED); }