Skip to content

Commit

Permalink
add buffer.shrink_to_fit() to reduce memory (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
gubaojian authored Oct 26, 2024
1 parent 6298a08 commit 6a0b70d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/AsyncSocketData.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct BackPressure {
void clear() {
pendingRemoval = 0;
buffer.clear();
buffer.shrink_to_fit();
}
void reserve(size_t length) {
buffer.reserve(length + pendingRemoval);
Expand Down

0 comments on commit 6a0b70d

Please sign in to comment.