Repository navigation
Conversation
PoolAllocator's node budget should only reserve space for implementation-defined std::unordered_map node-link overhead before the key caches any hash value. Drop the stale wording about standard-library hash-code storage and use 3 * sizeof(void*) consistently across the PoolAllocator unordered-map examples.
Keep SaltedOutpointHasher noexcept so normal unordered containers do not ask libstdc++ to store hash codes in every node. CCoinsMap still benefits from avoiding repeated salted outpoint hashing. Add a CCoinsMap-specific hasher that caches the hash in COutPoint and fills it through std::atomic_ref, so concurrent lookups can race only by recomputing and publishing the same cached value. Bump the CCoinsMap PoolAllocator slack back to four pointer-sized fields. CCoinsMap is the dominant memory consumer, so keep a conservative allowance for implementation-defined std::unordered_map node overhead instead of risking fall-through allocations on stdlibs with larger nodes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep SaltedOutpointHasher noexcept so normal unordered containers do not ask libstdc++ to store hash codes in every node.
CCoinsMap still benefits from avoiding repeated salted outpoint hashing. Cache the hash in COutPoint and let CCoinsMap use a map-specific hasher id so copied cache entries do not reuse a hash from a different map salt.
The cached hash is now part of the key object itself, so restore the pool allocator budget to four pointer-sized fields.