MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Release

Function Release

common/memory.h:646–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

PreReleaseFunction · 0.85

Tested by

no test coverage detected