1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:55:08 +00:00

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. :^)
This commit is contained in:
Andreas Kling 2021-06-10 17:39:35 +02:00
parent 22c803d8e5
commit d560ee118d

View file

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