Fix typo in Memory: reuse buffer if capacity allows.

This commit is contained in:
Alexander Kuzmenkov 2019-11-15 20:23:57 +03:00
parent ce92615add
commit 8f3bd8f546

View File

@ -77,7 +77,7 @@ struct Memory : boost::noncopyable, Allocator
m_capacity = new_size;
alloc();
}
else if (new_size <= m_size)
else if (new_size <= m_capacity - pad_right)
{
m_size = new_size;
return;