Skip to content
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

[5.0 -> 1.0] limit the vector size that can be reserved #603

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Aug 20, 2024

1.0 merge of AntelopeIO/leap#2405

The deserialization of arrays involves reading a size, and then the array elements which are emplace'd back into a std::vector. For normal vectors, since we know the size in advance, it is beneficial to call std::vector::reserve() to prevent quadratic reallocations of the vector's buffer as the values are read. Still, limit the size that can be reserved to 1024 fc::variant values, or 16KB since sizeof(fc::variant) == 16).

@greg7mdp greg7mdp requested review from heifner and arhag August 20, 2024 18:35
@arhag arhag changed the title [Leap 5.0 -> 1.0] fix true_lowest() for uint128[2] index + limit vector reserve [5.0 -> 1.0] limit the vector size that can be reserved Aug 20, 2024
@arhag arhag added this to the Spring v1.0.0-rc2 milestone Aug 20, 2024
@arhag arhag merged commit 9e6072a into release/1.0 Aug 20, 2024
35 checks passed
@arhag arhag deleted the gh_2330_1.0 branch August 20, 2024 19:19
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Limit vector size that can be reserved.
Note:end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants