Changeset View
Changeset View
Standalone View
Standalone View
src/memusage.h
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
template <typename X, typename Y, typename Z> | template <typename X, typename Y, typename Z> | ||||
static inline size_t DynamicUsage(const std::unordered_map<X, Y, Z> &m) { | static inline size_t DynamicUsage(const std::unordered_map<X, Y, Z> &m) { | ||||
return MallocUsage(sizeof(unordered_node<std::pair<const X, Y>>)) * | return MallocUsage(sizeof(unordered_node<std::pair<const X, Y>>)) * | ||||
m.size() + | m.size() + | ||||
MallocUsage(sizeof(void *) * m.bucket_count()); | MallocUsage(sizeof(void *) * m.bucket_count()); | ||||
} | } | ||||
} | } // namespace memusage | ||||
#endif // BITCOIN_MEMUSAGE_H | #endif // BITCOIN_MEMUSAGE_H |