diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-04-28 04:52:57 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-04-28 04:52:57 +0000 |
commit | e6b693db8cc07be91229bef0d8577ce8b5caf34b (patch) | |
tree | 085c50257a8cf8c1c913b4c78ddace3239c794a6 /include | |
parent | 235b830328586f0eb141f3263a0868166d80f478 (diff) | |
download | external_llvm-e6b693db8cc07be91229bef0d8577ce8b5caf34b.zip external_llvm-e6b693db8cc07be91229bef0d8577ce8b5caf34b.tar.gz external_llvm-e6b693db8cc07be91229bef0d8577ce8b5caf34b.tar.bz2 |
Add utility method to DenseMap to return the amount of memory used for its buckets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/DenseMap.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 332841f..8b2dbac 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -466,6 +466,15 @@ private: NumEntries = 0; } + +public: + /// Return the approximate size (in bytes) of the actual map. + /// This is just the raw memory used by DenseMap. + /// If entries are pointers to objects, the size of the referenced objects + /// are not included. + size_t getMemorySize() const { + return NumBuckets * sizeof(BucketT); + } }; template<typename KeyT, typename ValueT, |