mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:28:11 +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:
parent
22c803d8e5
commit
d560ee118d
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ BasicBlock::BasicBlock(String name)
|
||||||
// FIXME: This is not the smartest solution ever. Find something cleverer!
|
// 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
|
// 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.
|
// 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);
|
m_buffer = (u8*)mmap(nullptr, m_buffer_capacity, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
|
||||||
VERIFY(m_buffer != MAP_FAILED);
|
VERIFY(m_buffer != MAP_FAILED);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue