Commit 9454bc45 authored by Maged Michael's avatar Maged Michael Committed by Facebook GitHub Bot

HazptrDomain: Change DCHECK of tagged_empty() in dtor to a warning

Summary:
Replace DCHECK(tagged_empty()) with a warning.

The rationale is that the DCHECK was intended to help higher level users detect memory leaks, but since the DCHECK fails at domain destruction, the stack trace is not really helpful to users. By changing it to a warning, at least the user gets a hint that there may be a leak of object(s) that use hazptr_obj_cohort (e.g., ConcurrentHashMap, RequestContext).

Reviewed By: yfeldblum

Differential Revision: D28145864

fbshipit-source-id: 8a79e25efd21f0b1d713202f2fe8954c17a7d4de
parent 0ff4306d
...@@ -154,7 +154,11 @@ class hazptr_domain { ...@@ -154,7 +154,11 @@ class hazptr_domain {
shutdown_ = true; shutdown_ = true;
reclaim_all_objects(); reclaim_all_objects();
free_hazptr_recs(); free_hazptr_recs();
DCHECK(tagged_empty()); if (kIsDebug && !tagged_empty()) {
LOG(WARNING)
<< "Tagged objects remain. This may indicate a higher-level leak "
<< "of object(s) that use hazptr_obj_cohort.";
}
} }
hazptr_domain(const hazptr_domain&) = delete; hazptr_domain(const hazptr_domain&) = delete;
......
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