From 217485a2721c0089875f5957744118bcf605d6ba Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 30 Aug 2022 11:26:03 -0700 Subject: [PATCH] [windows] Fix cbf (#30790) --- .../ext/transport/chttp2/transport/hpack_parser_table.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h index 597f87ba5e1..a1b0733655b 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h @@ -56,7 +56,7 @@ class HPackTable { // reading the core static metadata table here; at that point we'd need our // own singleton static metadata in the correct order. if (index <= hpack_constants::kLastStaticEntry) { - return &NoDestructSingleton::Get()->memento[index - 1]; + return &static_mementos_->memento[index - 1]; } else { return LookupDynamic(index); } @@ -114,6 +114,11 @@ class HPackTable { void EvictOne(); + static const StaticMementos* GetStaticMementos() { + static const NoDestruct static_mementos; + return static_mementos.get(); + } + // The amount of memory used by the table, according to the hpack algorithm uint32_t mem_used_ = 0; // The max memory allowed to be used by the table, according to the hpack @@ -123,6 +128,8 @@ class HPackTable { uint32_t current_table_bytes_ = hpack_constants::kInitialTableSize; // HPack table entries MementoRingBuffer entries_; + // Static mementos + const StaticMementos* const static_mementos_ = GetStaticMementos(); }; } // namespace grpc_core