Remove maximal reallocation size in wxVector

This dramatically pessimizes performance for large vector sizes and
doesn't actually save that much memory because all intermediate
allocations are still being used by the process, so follow stdlibc++
example and just double the allocated buffer size without limit.
This commit is contained in:
Vadim Zeitlin 2017-11-18 17:32:58 +01:00
parent aef4edb969
commit 876090aeea

View File

@ -315,10 +315,8 @@ public:
//
// NB: casts to size_type are needed to suppress warnings about
// mixing enumeral and non-enumeral type in conditional expression
const size_type increment = m_size > 0
? m_size < ALLOC_MAX_SIZE
? m_size
: (size_type)ALLOC_MAX_SIZE
const size_type increment = m_size > ALLOC_INITIAL_SIZE
? m_size
: (size_type)ALLOC_INITIAL_SIZE;
if ( m_capacity + increment > n )
n = m_capacity + increment;
@ -491,7 +489,6 @@ public:
private:
static const size_type ALLOC_INITIAL_SIZE = 16;
static const size_type ALLOC_MAX_SIZE = 4096;
void Copy(const wxVector& vb)
{