ostream buffer growth was broken
It only grew by 3/2 of the needed size instead of the needed capacity, which could be extremely slow when growing by a constant amount many times.
This commit is contained in:
committed by
Mathias Agopian
parent
51392c77aa
commit
5dfd285105
@@ -95,11 +95,11 @@ protected:
|
||||
size_t length() const noexcept;
|
||||
|
||||
private:
|
||||
void reserve(size_t newSize) noexcept;
|
||||
void reserve(size_t newCapacity) noexcept;
|
||||
|
||||
char* buffer = nullptr; // buffer address
|
||||
char* curr = nullptr; // current pointer
|
||||
size_t size = 0; // size remaining
|
||||
size_t sizeRemaining = 0; // size remaining
|
||||
size_t capacity = 0; // total capacity of the buffer
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user