diff options
| author | Eugene Sandulenko | 2016-03-28 18:45:34 +0200 | 
|---|---|---|
| committer | Eugene Sandulenko | 2016-03-28 18:45:34 +0200 | 
| commit | f1fa8ea1ca2f083cec3391caef0f38826e5bbd6c (patch) | |
| tree | 694aa9b1faed98bbd6bc1344876955db77da80d8 /common | |
| parent | 674a208a7e28536dedfc7195a533d0a53011aa39 (diff) | |
| download | scummvm-rg350-f1fa8ea1ca2f083cec3391caef0f38826e5bbd6c.tar.gz scummvm-rg350-f1fa8ea1ca2f083cec3391caef0f38826e5bbd6c.tar.bz2 scummvm-rg350-f1fa8ea1ca2f083cec3391caef0f38826e5bbd6c.zip | |
COMMON: Use better reallocation strategy in MemoryWriteStreamDynamic.
Fixes bug #6983: "SWORD25: long saving time"
Diffstat (limited to 'common')
| -rw-r--r-- | common/memstream.h | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/common/memstream.h b/common/memstream.h index 5ecc553454..a01973c6fa 100644 --- a/common/memstream.h +++ b/common/memstream.h @@ -25,6 +25,7 @@  #include "common/stream.h"  #include "common/types.h" +#include "common/util.h"  namespace Common { @@ -170,7 +171,7 @@ private:  		byte *old_data = _data; -		_capacity = new_len + 32; +		_capacity = MAX(new_len + 32, _capacity * 2);  		_data = (byte *)malloc(_capacity);  		_ptr = _data + _pos; | 
