-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
Superseded. |
Not actually superseded, fixes a different unsoundness... |
Codecov ReportAttention: Patch coverage is
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. |
@@ -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); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
No description provided.