Skip to content

Commit 7596282

Browse files
committed
memusage: Allow counting usage of vectors with different allocators
1 parent 6463117 commit 7596282

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/memusage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ struct stl_shared_counter
8484
size_t weak_count;
8585
};
8686

87-
template<typename X>
88-
static inline size_t DynamicUsage(const std::vector<X>& v)
87+
template<typename T, typename Allocator>
88+
static inline size_t DynamicUsage(const std::vector<T, Allocator>& v)
8989
{
90-
return MallocUsage(v.capacity() * sizeof(X));
90+
return MallocUsage(v.capacity() * sizeof(T));
9191
}
9292

9393
template<unsigned int N, typename X, typename S, typename D>

0 commit comments

Comments
 (0)