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

refactor: Allocate proper buffer #19357

Merged
merged 2 commits into from
Oct 22, 2024
Merged

refactor: Allocate proper buffer #19357

merged 2 commits into from
Oct 22, 2024

Conversation

ritchie46
Copy link
Member

No description provided.

@ritchie46 ritchie46 added the skip changelog Do not include in changelog label Oct 21, 2024
@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Oct 21, 2024
@orlp orlp added the do not merge This pull requests should not be merged right now label Oct 21, 2024
@orlp
Copy link
Collaborator

orlp commented Oct 21, 2024

Superseded.

@orlp orlp closed this Oct 21, 2024
@orlp orlp reopened this Oct 21, 2024
@orlp
Copy link
Collaborator

orlp commented Oct 21, 2024

Not actually superseded, fixes a different unsoundness...

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.19%. Comparing base (8a76dad) to head (25cbcc3).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...s/polars-arrow/src/compute/take/fixed_size_list.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19357      +/-   ##
==========================================
- Coverage   80.24%   80.19%   -0.05%     
==========================================
  Files        1523     1523              
  Lines      209545   209839     +294     
  Branches     2434     2434              
==========================================
+ Hits       168148   168282     +134     
- Misses      40842    41002     +160     
  Partials      555      555              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -174,7 +175,7 @@ pub(super) unsafe fn take_unchecked<O: Index>(
let n_idx = indices.len();
let total_bytes = bytes_per_element * n_idx;

let mut buf = aligned_vec(total_bytes);
let mut buf = aligned_vec(leaves.dtype(), total_bytes);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically unsound if a panic occurs between the moment this is allocated until it is forgotten. Should probably wrap it in a ManuallyDrop.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point.

@ritchie46 ritchie46 merged commit 27289b2 into main Oct 22, 2024
17 of 19 checks passed
@ritchie46 ritchie46 deleted the buf branch October 22, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge This pull requests should not be merged right now internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars skip changelog Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants