Skip to content

Commit 0ea6b2a

Browse files
wang178ccopybara-github
authored andcommitted
Release the capacity after clear on two std::vector in QuicCryptoStream::ResetCryptoSubstreams.
clear does not release any memory. PiperOrigin-RevId: 869260248
1 parent ef414be commit 0ea6b2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

quiche/quic/core/quic_crypto_stream.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
#include <cstdint>
99
#include <memory>
1010
#include <string>
11+
#include <vector>
1112

1213
#include "absl/strings/str_cat.h"
1314
#include "absl/strings/string_view.h"
1415
#include "quiche/quic/core/crypto/crypto_handshake.h"
1516
#include "quiche/quic/core/frames/quic_crypto_frame.h"
1617
#include "quiche/quic/core/quic_connection.h"
1718
#include "quiche/quic/core/quic_error_codes.h"
19+
#include "quiche/quic/core/quic_interval_set.h"
1820
#include "quiche/quic/core/quic_session.h"
1921
#include "quiche/quic/core/quic_stream_send_buffer.h"
2022
#include "quiche/quic/core/quic_stream_send_buffer_base.h"
@@ -616,7 +618,9 @@ void QuicCryptoStream::ResetCryptoSubstreams() {
616618
}
617619
NeuterStreamDataOfEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
618620
bytes_consumed_.clear();
621+
std::vector<QuicIntervalSet<QuicStreamOffset>>().swap(bytes_consumed_);
619622
substreams_.clear();
623+
std::vector<CryptoSubstream>().swap(substreams_);
620624
QUICHE_CODE_COUNT(quic_crypto_stream_reset_crypto_substreams);
621625
}
622626

0 commit comments

Comments
 (0)