Skip to content

Commit 11f0b82

Browse files
author
qtum-neil
authored
Merge pull request bitcoin#367 from qtumproject/neil/fix-gitian-build
fix gitian build
2 parents 2d0f487 + 9a41e27 commit 11f0b82

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

src/coins.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#include <assert.h>
1717
#include <stdint.h>
1818

19-
#include <boost/foreach.hpp>
20-
#include <boost/unordered_map.hpp>
21-
2219
/**
2320
* A UTXO entry.
2421
*
@@ -125,7 +122,7 @@ struct CCoinsCacheEntry
125122
explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}
126123
};
127124

128-
typedef boost::unordered_map<COutPoint, CCoinsCacheEntry, SaltedOutpointHasher> CCoinsMap;
125+
typedef std::unordered_map<COutPoint, CCoinsCacheEntry, SaltedOutpointHasher> CCoinsMap;
129126

130127
/** Cursor for iterating over CoinsView state */
131128
class CCoinsViewCursor

src/memusage.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,26 @@ static inline size_t DynamicUsage(const boost::unordered_map<X, Y, Z>& m)
167167
return MallocUsage(sizeof(boost_unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count());
168168
}
169169

170+
//std version
171+
template<typename Xstd>
172+
struct unordered_node : private Xstd
173+
{
174+
private:
175+
void* ptr;
176+
};
177+
178+
template<typename Xstd, typename Y>
179+
static inline size_t DynamicUsage(const std::unordered_set<Xstd, Y>& s)
180+
{
181+
return MallocUsage(sizeof(unordered_node<Xstd>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count());
182+
}
183+
184+
template<typename Xstd, typename Y, typename Z>
185+
static inline size_t DynamicUsage(const std::unordered_map<Xstd, Y, Z>& m)
186+
{
187+
return MallocUsage(sizeof(unordered_node<std::pair<const Xstd, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count());
188+
}
189+
170190
}
171191

172192
#endif // BITCOIN_MEMUSAGE_H

0 commit comments

Comments
 (0)