Merge #10548: Use std::unordered_{map,set} (C++11) instead of boost::unordered_{map,set}

246a02f Use std::unordered_{map,set} (C++11) instead of boost::unordered_{map,set} (practicalswift)

Tree-SHA512: 35cd42012248174751e4b87efbc78689957f731d7710dea7e369974c6ec31b15b32d1537fb0d875c94c7ffb5046d9784735e218e5baeed96d525861dab6d4252
This commit is contained in:
Wladimir J. van der Laan 2017-06-08 12:45:27 +02:00 committed by Pasta
parent b6dc579be8
commit 7e7c3ce6ca
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE
2 changed files with 1 additions and 19 deletions

View File

@ -16,8 +16,6 @@
#include <unordered_set> #include <unordered_set>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
namespace memusage namespace memusage
{ {
@ -148,8 +146,6 @@ static inline size_t DynamicUsage(const std::shared_ptr<X>& p)
return p ? MallocUsage(sizeof(X)) + MallocUsage(sizeof(stl_shared_counter)) : 0; return p ? MallocUsage(sizeof(X)) + MallocUsage(sizeof(stl_shared_counter)) : 0;
} }
// Boost data structures
template<typename X> template<typename X>
struct unordered_node : private X struct unordered_node : private X
{ {
@ -157,18 +153,6 @@ private:
void* ptr; void* ptr;
}; };
template<typename X, typename Y>
static inline size_t DynamicUsage(const boost::unordered_set<X, Y>& s)
{
return MallocUsage(sizeof(unordered_node<X>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count());
}
template<typename X, typename Y, typename Z>
static inline size_t DynamicUsage(const boost::unordered_map<X, Y, Z>& m)
{
return MallocUsage(sizeof(unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count());
}
template<typename X, typename Y> template<typename X, typename Y>
static inline size_t DynamicUsage(const std::unordered_set<X, Y>& s) static inline size_t DynamicUsage(const std::unordered_set<X, Y>& s)
{ {

View File

@ -32,8 +32,6 @@
#include <atomic> #include <atomic>
#include <boost/unordered_map.hpp>
class CBlockIndex; class CBlockIndex;
class CBlockTreeDB; class CBlockTreeDB;
class CBloomFilter; class CBloomFilter;
@ -162,7 +160,7 @@ extern CScript COINBASE_FLAGS;
extern CCriticalSection cs_main; extern CCriticalSection cs_main;
extern CBlockPolicyEstimator feeEstimator; extern CBlockPolicyEstimator feeEstimator;
extern CTxMemPool mempool; extern CTxMemPool mempool;
typedef boost::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap; typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;
typedef std::unordered_multimap<uint256, CBlockIndex*, BlockHasher> PrevBlockMap; typedef std::unordered_multimap<uint256, CBlockIndex*, BlockHasher> PrevBlockMap;
extern BlockMap mapBlockIndex; extern BlockMap mapBlockIndex;
extern PrevBlockMap mapPrevBlockIndex; extern PrevBlockMap mapPrevBlockIndex;