replace mapNextTx with slimmer setSpends
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#ifndef BITCOIN_MEMUSAGE_H
|
||||
#define BITCOIN_MEMUSAGE_H
|
||||
|
||||
#include "indirectmap.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <map>
|
||||
@@ -106,6 +108,20 @@ static inline size_t IncrementalDynamicUsage(const std::map<X, Y, Z>& m)
|
||||
return MallocUsage(sizeof(stl_tree_node<std::pair<const X, Y> >));
|
||||
}
|
||||
|
||||
// indirectmap has underlying map with pointer as key
|
||||
|
||||
template<typename X, typename Y>
|
||||
static inline size_t DynamicUsage(const indirectmap<X, Y>& m)
|
||||
{
|
||||
return MallocUsage(sizeof(stl_tree_node<std::pair<const X*, Y> >)) * m.size();
|
||||
}
|
||||
|
||||
template<typename X, typename Y>
|
||||
static inline size_t IncrementalDynamicUsage(const indirectmap<X, Y>& m)
|
||||
{
|
||||
return MallocUsage(sizeof(stl_tree_node<std::pair<const X*, Y> >));
|
||||
}
|
||||
|
||||
// Boost data structures
|
||||
|
||||
template<typename X>
|
||||
|
||||
Reference in New Issue
Block a user