diff options
Diffstat (limited to 'src/memusage.h')
-rw-r--r-- | src/memusage.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/memusage.h b/src/memusage.h index 81e8702954..710120d285 100644 --- a/src/memusage.h +++ b/src/memusage.h @@ -12,10 +12,10 @@ #include <map> #include <set> #include <vector> +#include <unordered_map> +#include <unordered_set> #include <boost/foreach.hpp> -#include <boost/unordered_set.hpp> -#include <boost/unordered_map.hpp> namespace memusage { @@ -146,25 +146,23 @@ static inline size_t DynamicUsage(const std::shared_ptr<X>& p) return p ? MallocUsage(sizeof(X)) + MallocUsage(sizeof(stl_shared_counter)) : 0; } -// Boost data structures - template<typename X> -struct boost_unordered_node : private X +struct unordered_node : private X { private: void* ptr; }; template<typename X, typename Y> -static inline size_t DynamicUsage(const boost::unordered_set<X, Y>& s) +static inline size_t DynamicUsage(const std::unordered_set<X, Y>& s) { - return MallocUsage(sizeof(boost_unordered_node<X>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count()); + return MallocUsage(sizeof(unordered_node<X>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count()); } template<typename X, typename Y, typename Z> -static inline size_t DynamicUsage(const boost::unordered_map<X, Y, Z>& m) +static inline size_t DynamicUsage(const std::unordered_map<X, Y, Z>& m) { - return MallocUsage(sizeof(boost_unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count()); + return MallocUsage(sizeof(unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count()); } } |