Skip to content

Reduce malloc churn for console calls <=128KiB #18287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/server/ApiMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ try

// If we were previously called with a huge buffer we have an equally large _inputBuffer.
// We shouldn't just keep this huge buffer around, if no one needs it anymore.
if (_inputBuffer.capacity() > 16 * 1024 && (_inputBuffer.capacity() >> 1) > cbReadSize)
if (_inputBuffer.capacity() > 128 * 1024 && (_inputBuffer.capacity() >> 1) > cbReadSize)
{
_inputBuffer.shrink_to_fit();
}
Expand Down Expand Up @@ -151,7 +151,7 @@ try

// If we were previously called with a huge buffer we have an equally large _outputBuffer.
// We shouldn't just keep this huge buffer around, if no one needs it anymore.
if (_outputBuffer.capacity() > 16 * 1024 && (_outputBuffer.capacity() >> 1) > cbWriteSize)
if (_outputBuffer.capacity() > 128 * 1024 && (_outputBuffer.capacity() >> 1) > cbWriteSize)
{
_outputBuffer.shrink_to_fit();
}
Expand Down
Loading