mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +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:
parent
a0b939cef4
commit
f388d2362a
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue