Skip to content

Commit

Permalink
Update comment for why templated function for Grow<> does not work here
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 546289557
  • Loading branch information
martijnvels authored and copybara-github committed Jul 7, 2023
1 parent cca0eee commit 5db61db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/google/protobuf/repeated_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,11 @@ PROTOBUF_NOINLINE void RepeatedField<Element>::GrowNoAnnotate(int current_size,
arena_or_elements_ = new_rep->elements();
}

// TODO(b/266411038): we should really be able to make this:
// template <bool annotate_size = true>
// void Grow();
// Ideally we would be able to use:
// template <bool annotate_size = true>
// void Grow();
// However, as explained in b/266411038#comment9, this causes issues
// in shared libraries for Youtube (and possibly elsewhere).
template <typename Element>
PROTOBUF_NOINLINE void RepeatedField<Element>::Grow(int current_size,
int new_size) {
Expand Down

0 comments on commit 5db61db

Please sign in to comment.