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

Fix/flat buffer #31

Merged
merged 3 commits into from
Jul 29, 2024
Merged

Fix/flat buffer #31

merged 3 commits into from
Jul 29, 2024

Conversation

cmazakas
Copy link
Collaborator

@cmazakas cmazakas commented Jul 24, 2024

This PR seems to also break a test in http-proto, which will need to be address later on.

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.08%. Comparing base (a996ce5) to head (80a541a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop      #31   +/-   ##
========================================
  Coverage    99.08%   99.08%           
========================================
  Files           28       28           
  Lines          766      766           
========================================
  Hits           759      759           
  Misses           7        7           
Files Coverage Δ
include/boost/buffers/flat_buffer.hpp 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a996ce5...80a541a. Read the comment docs.

@vinniefalco
Copy link
Member

Looks benign and I would like @ashtum to review these small, non-controversial things.

Also is there an issue for shrink_to_fit?

@cmazakas
Copy link
Collaborator Author

Looks benign and I would like @ashtum to review these small, non-controversial things.

Also is there an issue for shrink_to_fit?

Yup, it's right here: #30

@@ -96,7 +96,7 @@ class flat_buffer
std::size_t
capacity() const noexcept
{
return cap_ - in_pos_;
return cap_ - (in_pos_ + in_size_);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct for now, but it will change again once when we address #30.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe not, because shrink_to_fit would be a manual action and wouldn't happen automatically when calling prepare.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can implement shrink_to_fit and then after, decide if we want this behavior to be automatic in prepare.

@cmazakas cmazakas merged commit aaa070c into cppalliance:develop Jul 29, 2024
58 checks passed
@cmazakas cmazakas deleted the fix/flat-buffer branch July 29, 2024 22:06
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