@@ -394,7 +394,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
394394 // time. Note that we can often devirtualize calls to `value->GetArena()` so
395395 // usually calling this method is unnecessary.
396396 template <typename T>
397- PROTOBUF_ALWAYS_INLINE static Arena* GetArena (const T* value) {
397+ PROTOBUF_ALWAYS_INLINE static Arena* GetArena (T* value) {
398398 return GetArenaInternal (value);
399399 }
400400
@@ -432,31 +432,31 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
432432
433433 static void InternalSwap (T* a, T* b) { a->InternalSwap (b); }
434434
435- static Arena* GetArenaForAllocation (const T* p) {
435+ static Arena* GetArenaForAllocation (T* p) {
436436 return GetArenaForAllocation (Rank0{}, p);
437437 }
438438
439- static Arena* GetArena (const T* p) {
439+ static Arena* GetArena (T* p) {
440440 // Rather than replicate probing for `GetArena` with fallback to nullptr,
441441 // we borrow the implementation of `GetArenaForAllocation` but skip
442442 // `Rank0` which probes for `GetArenaForAllocation`.
443443 return GetArenaForAllocation (Rank1{}, p);
444444 }
445445
446446 template <typename U>
447- static auto GetArenaForAllocation (Rank0, const U* p)
447+ static auto GetArenaForAllocation (Rank0, U* p)
448448 -> EnableIfArena<decltype(p->GetArenaForAllocation ())> {
449449 return p->GetArenaForAllocation ();
450450 }
451451
452452 template <typename U>
453- static auto GetArenaForAllocation (Rank1, const U* p)
453+ static auto GetArenaForAllocation (Rank1, U* p)
454454 -> EnableIfArena<decltype(p->GetArena ())> {
455455 return p->GetArena ();
456456 }
457457
458458 template <typename U>
459- static Arena* GetArenaForAllocation (Rank2, const U*) {
459+ static Arena* GetArenaForAllocation (Rank2, U*) {
460460 return nullptr ;
461461 }
462462
@@ -506,7 +506,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
506506 // Provides access to protected GetArenaForAllocation to generated messages.
507507 // For internal use only.
508508 template <typename T>
509- static Arena* InternalGetArenaForAllocation (const T* p) {
509+ static Arena* InternalGetArenaForAllocation (T* p) {
510510 return InternalHelper<T>::GetArenaForAllocation (p);
511511 }
512512
@@ -650,7 +650,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
650650 // InternalArenaConstructable_ tags can be associated with an arena, and such
651651 // objects must implement a GetArena() method.
652652 template <typename T>
653- PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal (const T* value) {
653+ PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal (T* value) {
654654 return InternalHelper<T>::GetArena (value);
655655 }
656656
0 commit comments