forked from nashsclay/DAPSCoin
-
Notifications
You must be signed in to change notification settings - Fork 14
8000 [Upstream] [Core] Prevector #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Fixes a bug in which pop_back did not call the deleted item's destructor. Using the most general erase() implementation to implement all the others prevents similar bugs because the coupling between deallocation and destructor invocation only needs to be maintained in one place. Also reduces duplication of complex memmove logic. backports bitcoin/bitcoin@1e2c29f
swap was using an incorrect condition to determine when to apply an optimization (not swapping the full direct[] when swapping two indirect prevectors). Rather than correct the optimization I'm removing it for simplicity. Removing this optimization minutely improves performance in the typical (currently only) usage of member swap(), which is swapping with a freshly value-initialized object. backports bitcoin/bitcoin@a7af72a
- add a swap operation to prevector tests (fails due to broken prevector::swap) - fix 2 prevector test operation conditions that were impossible backports bitcoin/bitcoin@4ed41a2
This returns a pointer to the beginning of the vector's data. backports bitcoin/bitcoin@47314e6
Implement `begin_ptr` and `end_ptr` in terms of C++11 code, and add a comment that they are deprecated. backports bitcoin/bitcoin@f00705a
Such moves are used when reallocating vectors that contain them, for example. backports bitcoin/bitcoin@2ddfcfd
and don't loop in clear backports bitcoin/bitcoin@45a5aaf
Jamesj66
approved these changes
Aug 15, 2022
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.
from PIVX-Project/PIVX#1557
additional info:
payee
is astd::vector<unsigned char>
vs aCScript
- adapted in ddba851 - leads to a memory error if not done