Commit 2b4649b4 authored by Tushar Pankaj's avatar Tushar Pankaj Committed by Facebook GitHub Bot

Add use-after-destruction error messages

Summary: `ConcurrentHashMap` has a `DCHECK` for use-after-destruction. One of these has a comment explaining what it's for, but `DCHECK` supports taking a message to show the user. Make it a message.

Reviewed By: yfeldblum, magedm

Differential Revision: D28609176

fbshipit-source-id: ea6e57b7650ad597f45ea3efc2fa0fb62d5de40e
parent 51ae3ffb
......@@ -610,7 +610,7 @@ class alignas(64) BucketTable {
break;
}
}
DCHECK(buckets);
DCHECK(buckets) << "Use-after-destruction by user.";
}
template <typename MatchFunc, typename K, typename... Args>
......@@ -638,7 +638,7 @@ class alignas(64) BucketTable {
bcount = bucket_count_.load(std::memory_order_relaxed);
}
DCHECK(buckets); // Use-after-destruction by user.
DCHECK(buckets) << "Use-after-destruction by user.";
auto idx = getIdx(bcount, h);
auto head = &buckets->buckets_[idx]();
auto node = head->load(std::memory_order_relaxed);
......
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