mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge bitcoin/bitcoin#24050: validation: Give m_block_index ownership of CBlockIndexs
6c23c41561refactor: Rewrite AddToBlockIndex with try_emplace (Carl Dong)c05cf7aa1estyle: Modernize range-based loops over m_block_index (Carl Dong)c2a1655799style-only: Use using instead of typedef for BlockMap (Carl Dong)dd79dad175refactor: Rewrite InsertBlockIndex with try_emplace (Carl Dong)531dce0347tests: Remove now-unnecessary manual Unload's (Carl Dong)bec86ae326blockstorage: Make m_block_index own CBlockIndex's (Carl Dong) Pull request description: Part of: #24303 Split off from: #22564 ``` Instead of having CBlockIndex's live on the heap, which requires manual memory management, have them be owned by m_block_index. This means that they will live and die with BlockManager. ``` The second commit demonstrates how this makes calls to `Unload()` to satisfy the address sanitizer unnecessary. ACKs for top commit: ajtowns: ACK6c23c41561MarcoFalke: re-ACK6c23c41561🎨 Tree-SHA512: 81b2b5119be27cc0f8a9457b11da60cc60930315d2a5be36be89fe253d32073ffe622348ff153114b9b3212197bddbc791810913a43811b33cc58e7162bd105b
This commit is contained in:
@@ -72,9 +72,6 @@ BOOST_AUTO_TEST_CASE(validation_chainstate_resize_caches)
|
||||
// The view cache should be empty since we had to destruct to downsize.
|
||||
BOOST_CHECK(!c1.CoinsTip().HaveCoinInCache(outpoint));
|
||||
}
|
||||
|
||||
// Avoid triggering the address sanitizer.
|
||||
WITH_LOCK(::cs_main, manager.Unload());
|
||||
}
|
||||
|
||||
//! Test UpdateTip behavior for both active and background chainstates.
|
||||
|
||||
@@ -99,8 +99,6 @@ BOOST_AUTO_TEST_CASE(chainstatemanager)
|
||||
|
||||
// Let scheduler events finish running to avoid accessing memory that is going to be unloaded
|
||||
SyncWithValidationInterfaceQueue();
|
||||
|
||||
WITH_LOCK(::cs_main, manager.Unload());
|
||||
}
|
||||
|
||||
//! Test rebalancing the caches associated with each chainstate.
|
||||
|
||||
Reference in New Issue
Block a user