Merge ec4d27fa8b into merged_master (Bitcoin PR #18216)

This commit is contained in:
Andrew Poelstra 2020-11-26 01:08:40 +00:00
commit f32fd217a5
15 changed files with 81 additions and 76 deletions

View file

@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(getcoinscachesizestate)
// (prevector<28, unsigned char>) when assigned 56 bytes of data per above.
//
// See also: Coin::DynamicMemoryUsage().
constexpr int COIN_SIZE = is_64_bit ? 80 : 64;
constexpr unsigned int COIN_SIZE = is_64_bit ? 80 : 64;
auto print_view_mem_usage = [](CCoinsViewCache& view) {
BOOST_TEST_MESSAGE("CCoinsViewCache memory usage: " << view.DynamicMemoryUsage());
@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(getcoinscachesizestate)
}
print_view_mem_usage(view);
BOOST_CHECK_EQUAL(view.DynamicMemoryUsage(), is_64_bit ? 32 : 16);
BOOST_CHECK_EQUAL(view.DynamicMemoryUsage(), is_64_bit ? 32U : 16U);
// We should be able to add COINS_UNTIL_CRITICAL coins to the cache before going CRITICAL.
// This is contingent not only on the dynamic memory usage of the Coins