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

Add UniqueFD and ScopeExit #973

Merged
merged 11 commits into from
Oct 12, 2022
Merged

Add UniqueFD and ScopeExit #973

merged 11 commits into from
Oct 12, 2022

Conversation

PragmaTwice
Copy link
Member

@PragmaTwice PragmaTwice commented Oct 11, 2022

UniqueFD is a wrapped file descriptor with owership management, i.e. a unique_ptr-version fd.

ScopeExit is a scope guard like std::experimental::scope_exit in the library fundamentals v3 from WG21 or boost::scope_guard in Boost.

src/util.cc Show resolved Hide resolved
Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

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

Overall looks good to me

src/redis_cmd.cc Outdated Show resolved Hide resolved
src/stats.cc Outdated Show resolved Hide resolved
src/redis_cmd.cc Outdated Show resolved Hide resolved
src/stats.cc Outdated Show resolved Hide resolved
tisonkun
tisonkun previously approved these changes Oct 11, 2022
Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

LGTM. Although, as we write more and more code, it can be a good time to try modularizing source files into folders.

src/fd_util.h Outdated Show resolved Hide resolved
@PragmaTwice
Copy link
Member Author

LGTM. Although, as we write more and more code, it can be a good time to try modularizing source files into folders.

Good idea, I will try to do this.

@git-hulk git-hulk merged commit fad697a into apache:unstable Oct 12, 2022
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.

5 participants