mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
Call ReallocateCache() on each Flush()
This frees up all associated memory with the map, not only the nodes. This is necessary in preparation for using the PoolAllocator for CCoinsMap, which does not actually free any memory on clear().
This commit is contained in:
@@ -131,8 +131,7 @@ BOOST_AUTO_TEST_CASE(getcoinscachesizestate)
|
||||
CoinsCacheSizeState::OK);
|
||||
}
|
||||
|
||||
// Flushing the view doesn't take us back to OK because cacheCoins has
|
||||
// preallocated memory that doesn't get reclaimed even after flush.
|
||||
// Flushing the view does take us back to OK because ReallocateCache() is called
|
||||
|
||||
BOOST_CHECK_EQUAL(
|
||||
chainstate.GetCoinsCacheSizeState(MAX_COINS_CACHE_BYTES, 0),
|
||||
@@ -144,7 +143,7 @@ BOOST_AUTO_TEST_CASE(getcoinscachesizestate)
|
||||
|
||||
BOOST_CHECK_EQUAL(
|
||||
chainstate.GetCoinsCacheSizeState(MAX_COINS_CACHE_BYTES, 0),
|
||||
CoinsCacheSizeState::CRITICAL);
|
||||
CoinsCacheSizeState::OK);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user