Commit 81e350e1 authored by Daniel Xu's avatar Daniel Xu Committed by Facebook GitHub Bot

Use assert() instead of DCHECK

Summary:
We were seeing the following build failures on i386:
```
In file included from folly/stats/detail/BufferedStat.h:151,
                 from folly/stats/QuantileEstimator.h:20,
                 from folly/stats/QuantileEstimator.cpp:17:
folly/stats/detail/BufferedStat-inl.h: In member function 'void folly::detail::BufferedStat<DigestT, ClockT>::doUpdate(folly::detail::BufferedStat<DigestT, ClockT>::TimePoint, const std::unique_lock<folly::SharedMutexImpl<false> >&, folly::detail::BufferedStat<DigestT, ClockT>::UpdateMode)':
folly/stats/detail/BufferedStat-inl.h:72:3: error: there are no arguments to 'DCHECK' that depend on a template parameter, so a declaration of 'DCHECK' must be available [-fpermissive]
   72 |   DCHECK(g.owns_lock());
      |   ^~~~~~
```

My best guess is some kind of argument dependent lookup complication.

This diff sidesteps the issue by using plain old `assert()` instead

Reviewed By: yfeldblum

Differential Revision: D24375147

fbshipit-source-id: d702d883fcabc548e8f4969207e265abf21acf2b
parent a07ea58a
...@@ -69,7 +69,7 @@ void BufferedStat<DigestT, ClockT>::doUpdate( ...@@ -69,7 +69,7 @@ void BufferedStat<DigestT, ClockT>::doUpdate(
TimePoint now, TimePoint now,
const std::unique_lock<SharedMutex>& g, const std::unique_lock<SharedMutex>& g,
UpdateMode updateMode) { UpdateMode updateMode) {
DCHECK(g.owns_lock()); assert(g.owns_lock());
// Check that no other thread has performed the slide after the check // Check that no other thread has performed the slide after the check
auto oldExpiry = expiry_.load(std::memory_order_relaxed).tp; auto oldExpiry = expiry_.load(std::memory_order_relaxed).tp;
if (now > oldExpiry || updateMode == UpdateMode::Now) { if (now > oldExpiry || updateMode == UpdateMode::Now) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment