mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
lang/c/msgpack: C++ binding: enlarged chunk size of zone
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@58 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
parent
94cbe54cf3
commit
97bc0441b1
4 changed files with 26 additions and 17 deletions
|
|
@ -78,7 +78,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; }
|
||||
else { next_size = MSGPACK_UNPACKER_INITIAL_BUFFER_SIZE; }
|
||||
else { next_size = UNPACKER_INITIAL_BUFFER_SIZE; }
|
||||
while(next_size < len + m_used) { next_size *= 2; }
|
||||
|
||||
// FIXME realloc?
|
||||
|
|
@ -91,7 +91,7 @@ void unpacker::expand_buffer(size_t len)
|
|||
m_free = next_size - m_used;
|
||||
|
||||
} else {
|
||||
size_t next_size = MSGPACK_UNPACKER_INITIAL_BUFFER_SIZE;
|
||||
size_t next_size = UNPACKER_INITIAL_BUFFER_SIZE;
|
||||
while(next_size < len + m_used - m_off) { next_size *= 2; }
|
||||
|
||||
void* tmp = malloc(next_size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue