Fix typo in Memory: reuse buffer if capacity allows. (#7797)

This commit is contained in:
Alexander Kuzmenkov 2019-11-18 18:21:03 +03:00 committed by GitHub
parent 7084d090e8
commit fbee4ca3ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;