diff --git a/src/coins.h b/src/coins.h --- a/src/coins.h +++ b/src/coins.h @@ -16,7 +16,7 @@ #include #include -#include +#include /** * A UTXO entry. @@ -296,6 +296,9 @@ * This *must* return size_t. With Boost 1.46 on 32-bit systems the * unordered_map will behave unpredictably if the custom hasher returns a * uint64_t, resulting in failures when syncing the chain (#4634). + * Note: This information above might be outdated as the unordered map + * container type has meanwhile been switched to the C++ standard library + * implementation. */ size_t operator()(const uint256 &txid) const { return SipHashUint256(k0, k1, txid); @@ -321,7 +324,7 @@ CCoinsCacheEntry() : coins(), flags(0) {} }; -typedef boost::unordered_map +typedef std::unordered_map CCoinsMap; /** Cursor for iterating over CoinsView state */ diff --git a/src/memusage.h b/src/memusage.h --- a/src/memusage.h +++ b/src/memusage.h @@ -13,8 +13,8 @@ #include #include -#include -#include +#include +#include namespace memusage { @@ -161,20 +161,20 @@ // Boost data structures -template struct boost_unordered_node : private X { +template struct unordered_node : private X { private: void *ptr; }; template -static inline size_t DynamicUsage(const boost::unordered_set &s) { - return MallocUsage(sizeof(boost_unordered_node)) * s.size() + +static inline size_t DynamicUsage(const std::unordered_set &s) { + return MallocUsage(sizeof(unordered_node)) * s.size() + MallocUsage(sizeof(void *) * s.bucket_count()); } template -static inline size_t DynamicUsage(const boost::unordered_map &m) { - return MallocUsage(sizeof(boost_unordered_node>)) * +static inline size_t DynamicUsage(const std::unordered_map &m) { + return MallocUsage(sizeof(unordered_node>)) * m.size() + MallocUsage(sizeof(void *) * m.bucket_count()); } diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -31,7 +31,7 @@ #include #include -#include +#include class CBlockIndex; class CBlockTreeDB; @@ -174,7 +174,7 @@ extern CScript COINBASE_FLAGS; extern CCriticalSection cs_main; extern CTxMemPool mempool; -typedef boost::unordered_map BlockMap; +typedef std::unordered_map BlockMap; extern BlockMap mapBlockIndex; extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize;