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

Move the smarts of fill_buf() to r_vector.hpp #379

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Aug 9, 2024

Closes #374

Comment on lines -58 to +59
unwind_protect([&] { RAW_GET_REGION(data_->data_, pos, length_, buf_.data()); });
block_start_ = pos;
inline void r_vector<uint8_t>::get_region(
SEXP x, R_xlen_t i, R_xlen_t n,
typename traits::get_underlying_type<uint8_t>::type* buf) {
// NOPROTECT: likely too costly to unwind protect here
RAW_GET_REGION(x, i, n, buf);
Copy link
Member Author

Choose a reason for hiding this comment

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

No other implementation was using unwind_protect(), so I'm no longer doing it here either

@DavisVaughan DavisVaughan merged commit 5167fa4 into r-lib:main Aug 9, 2024
16 checks passed
@DavisVaughan DavisVaughan deleted the feature/unify-fill-buf branch August 9, 2024 19:52
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.

raws fill_buf does unwind-protect but none of the other specializations do
1 participant