From 5db61db33130ca80b6a7edec54e1089d0ccbf6ce Mon Sep 17 00:00:00 2001 From: Martijn Vels Date: Fri, 7 Jul 2023 08:33:08 -0700 Subject: [PATCH] Update comment for why templated function for Grow<> does not work here PiperOrigin-RevId: 546289557 --- src/google/protobuf/repeated_field.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index d078c60842c7..ae04c2094290 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -1064,9 +1064,11 @@ PROTOBUF_NOINLINE void RepeatedField::GrowNoAnnotate(int current_size, arena_or_elements_ = new_rep->elements(); } -// TODO(b/266411038): we should really be able to make this: -// template -// void Grow(); +// Ideally we would be able to use: +// template +// void Grow(); +// However, as explained in b/266411038#comment9, this causes issues +// in shared libraries for Youtube (and possibly elsewhere). template PROTOBUF_NOINLINE void RepeatedField::Grow(int current_size, int new_size) {