Skip to content

Commit 35e7f13

Browse files
committed
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
2 parents 71ab6e5 + 246a02f commit 35e7f13

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/memusage.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include <unordered_set>
1717

1818
#include <boost/foreach.hpp>
19-
#include <boost/unordered_set.hpp>
20-
#include <boost/unordered_map.hpp>
2119

2220
namespace memusage
2321
{
@@ -148,27 +146,13 @@ static inline size_t DynamicUsage(const std::shared_ptr<X>& p)
148146
return p ? MallocUsage(sizeof(X)) + MallocUsage(sizeof(stl_shared_counter)) : 0;
149147
}
150148

151-
// Boost data structures
152-
153149
template<typename X>
154150
struct unordered_node : private X
155151
{
156152
private:
157153
void* ptr;
158154
};
159155

160-
template<typename X, typename Y>
161-
static inline size_t DynamicUsage(const boost::unordered_set<X, Y>& s)
162-
{
163-
return MallocUsage(sizeof(unordered_node<X>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count());
164-
}
165-
166-
template<typename X, typename Y, typename Z>
167-
static inline size_t DynamicUsage(const boost::unordered_map<X, Y, Z>& m)
168-
{
169-
return MallocUsage(sizeof(unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count());
170-
}
171-
172156
template<typename X, typename Y>
173157
static inline size_t DynamicUsage(const std::unordered_set<X, Y>& s)
174158
{

src/validation.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#include <atomic>
3232

33-
#include <boost/unordered_map.hpp>
34-
3533
class CBlockIndex;
3634
class CBlockTreeDB;
3735
class CBloomFilter;
@@ -161,7 +159,7 @@ extern CScript COINBASE_FLAGS;
161159
extern CCriticalSection cs_main;
162160
extern CBlockPolicyEstimator feeEstimator;
163161
extern CTxMemPool mempool;
164-
typedef boost::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;
162+
typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;
165163
extern BlockMap mapBlockIndex;
166164
extern uint64_t nLastBlockTx;
167165
extern uint64_t nLastBlockSize;

0 commit comments

Comments
 (0)