mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-10 20:53:50 +01:00
memusage: Allow counting usage of vectors with different allocators
This commit is contained in:
@@ -84,10 +84,10 @@ struct stl_shared_counter
|
|||||||
size_t weak_count;
|
size_t weak_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename X>
|
template<typename T, typename Allocator>
|
||||||
static inline size_t DynamicUsage(const std::vector<X>& v)
|
static inline size_t DynamicUsage(const std::vector<T, Allocator>& v)
|
||||||
{
|
{
|
||||||
return MallocUsage(v.capacity() * sizeof(X));
|
return MallocUsage(v.capacity() * sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<unsigned int N, typename X, typename S, typename D>
|
template<unsigned int N, typename X, typename S, typename D>
|
||||||
|
|||||||
Reference in New Issue
Block a user