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

Riegeli usage cleanup: #129

Closed
wants to merge 0 commits into from
Closed

Riegeli usage cleanup: #129

wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Nov 9, 2024

Riegeli usage cleanup:

Use riegeli::SharedPtr instead of std::shared_ptr. Do not convert it from
std::unique_ptr: riegeli::SharedPtr always allocates the control block
together with the object, hence this is not supported, and this is more
efficient anyway.

Utilize CTAD more.

Let MaskedReader constructor take riegeli::Reader& instead of
std::unique_ptr<riegeli::Reader>. There is no ownership transfer, the
riegeli::Reader is accessed only during construction.

Use riegeli::SharedBuffer instead of std::shared_ptr<std::string> in
MaskedReader. It has faster refcounting and a smaller overhead. It does not
track the exact size but this is not needed here.

Use defaulted move constructor and move assignment of MaskedReader. They do
the right thing.

Add MaskedReader::Reset() to reset the instance to a state equivalent to a
newly constructed state in-place.

Use std::optional instead of absl::optional.

Use std::optional or storing the value directly instead of std::unique_ptr
when movability is not needed.

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.

0 participants