[build] Windows build fix (#37402)

Closes #37402

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37402 from ctiller:windoze 488ca2996c
PiperOrigin-RevId: 659708332
pull/37403/head
Craig Tiller 4 months ago committed by Copybara-Service
parent 33fa301c5b
commit 5e80db3616
  1. 6
      src/core/util/unique_ptr_with_bitset.h

@ -35,7 +35,10 @@ class UniquePtrWithBitset {
// NOLINTNEXTLINE(google-explicit-constructor)
UniquePtrWithBitset(std::unique_ptr<T>&& p)
: UniquePtrWithBitset(p.release()) {}
~UniquePtrWithBitset() { delete get(); }
~UniquePtrWithBitset() {
DCHECK_LE(kBits, static_cast<size_t>(absl::countr_zero(alignof(T))));
delete get();
}
UniquePtrWithBitset(const UniquePtrWithBitset&) = delete;
UniquePtrWithBitset& operator=(const UniquePtrWithBitset&) = delete;
UniquePtrWithBitset(UniquePtrWithBitset&& other) noexcept
@ -74,7 +77,6 @@ class UniquePtrWithBitset {
}
private:
static_assert(kBits <= absl::countr_zero(alignof(T)), "kBits too large");
static constexpr uintptr_t kBitMask = (1 << kBits) - 1;
uintptr_t p_;
};

Loading…
Cancel
Save