mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibJS: Pad the capacity of BasicBlock while growing it
Just using Vector::resize() meant that we allocated exact capacity instead of leaving padding at the end. This patch adds a call to grow_capacity() before resize(), which ensures that we grow with the usual extra padding.
This commit is contained in:
@@ -43,6 +43,7 @@ void BasicBlock::dump(Bytecode::Executable const& executable) const
|
||||
|
||||
void BasicBlock::grow(size_t additional_size)
|
||||
{
|
||||
m_buffer.grow_capacity(m_buffer.size() + additional_size);
|
||||
m_buffer.resize(m_buffer.size() + additional_size);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user