| 644 | } |
| 645 | |
| 646 | void Release(T** ptr, Owner* owner) noexcept { |
| 647 | if (ptr_ == nullptr) { |
| 648 | *ptr = nullptr; |
| 649 | return; |
| 650 | } |
| 651 | PreRelease(); |
| 652 | *ptr = std::exchange(ptr_, nullptr); |
| 653 | if (arena_ == 0) { |
| 654 | owner->ptr_ = reinterpret_cast<uintptr_t>( |
| 655 | common_internal::MakeDeletingReferenceCount(*ptr)) | |
| 656 | common_internal::kMetadataOwnerReferenceCountBit; |
| 657 | } else { |
| 658 | owner->ptr_ = reinterpret_cast<uintptr_t>(arena()) | |
| 659 | common_internal::kMetadataOwnerArenaBit; |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | T* ptr_ = nullptr; |
| 664 | // Potentially tagged pointer to `google::protobuf::Arena`. The tag is used to determine |
nothing calls this directly
no test coverage detected