replace mapNextTx with slimmer setSpends

This commit is contained in:
Kaz Wesley
2016-04-30 21:45:26 -07:00
committed by lateminer
parent 17401c86d1
commit 000a97ca5f
6 changed files with 96 additions and 41 deletions

View File

@@ -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>