mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
lang/c/msgpack: msgpack::unpacker: fix buffer reallocation algorithm
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@76 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
parent
c3021d3236
commit
ccdb39ac60
1 changed files with 1 additions and 1 deletions
|
|
@ -198,7 +198,7 @@ void unpacker::expand_buffer(size_t len)
|
|||
{
|
||||
if(m_off == 0) {
|
||||
size_t next_size;
|
||||
if(m_free != 0) { next_size = m_free * 2; }
|
||||
if(m_used != 0) { next_size = (m_used + m_free) * 2; }
|
||||
else { next_size = UNPACKER_INITIAL_BUFFER_SIZE; }
|
||||
while(next_size < len + m_used) { next_size *= 2; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue