* Now Append will work properly if strLen is big (for example 3xm_capacity). And value 1.5 is better for memory growth.
* Correct way of calculating 1.5 (without floating point calculation, thanks mikedn)
* After long discussion we decided that simple and aggressive allocation is better for this case
Commit migrated from https://github.com/dotnet/coreclr/commit/
c637c919adcd0c0d7fcd8818810bcb727408fa51
m_capacity = m_defaultSize;
}
if (m_length + strLen + 1 > m_capacity) {
- size_t newCapacity = m_capacity * 2;
+ size_t newCapacity = (m_length + strLen + 1) * 2;
wchar_t* newBuffer = new wchar_t[newCapacity];
wcsncpy_s(newBuffer, newCapacity, m_buffer, m_length);
delete[] m_buffer;