diff options
Diffstat (limited to 'compiler/utils/dedupe_set-inl.h')
-rw-r--r-- | compiler/utils/dedupe_set-inl.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/utils/dedupe_set-inl.h b/compiler/utils/dedupe_set-inl.h index 4e892f2616..d4a9cc829b 100644 --- a/compiler/utils/dedupe_set-inl.h +++ b/compiler/utils/dedupe_set-inl.h @@ -81,6 +81,11 @@ class DedupeSet<InKey, StoreKey, Alloc, HashType, HashFunc, kShard>::Shard { return store_key; } + size_t Size(Thread* self) { + MutexLock lock(self, lock_); + return keys_.size(); + } + void UpdateStats(Thread* self, Stats* global_stats) REQUIRES(!lock_) { // HashSet<> doesn't keep entries ordered by hash, so we actually allocate memory // for bookkeeping while collecting the stats. @@ -234,6 +239,20 @@ template <typename InKey, typename HashType, typename HashFunc, HashType kShard> +size_t DedupeSet<InKey, StoreKey, Alloc, HashType, HashFunc, kShard>::Size(Thread* self) const { + size_t result = 0u; + for (const auto& shard : shards_) { + result += shard->Size(self); + } + return result; +} + +template <typename InKey, + typename StoreKey, + typename Alloc, + typename HashType, + typename HashFunc, + HashType kShard> std::string DedupeSet<InKey, StoreKey, Alloc, HashType, HashFunc, kShard>::DumpStats( Thread* self) const { Stats stats; |