-
Notifications
You must be signed in to change notification settings - Fork 784
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
Require Send+Sync bounds for Allocation trait #1945
Require Send+Sync bounds for Allocation trait #1945
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1945 +/- ##
==========================================
- Coverage 83.48% 83.47% -0.01%
==========================================
Files 221 221
Lines 57054 57054
==========================================
- Hits 47629 47627 -2
- Misses 9425 9427 +2
Continue to review full report at Codecov.
|
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.
I re-read https://doc.rust-lang.org/nomicon/send-and-sync.html and this change makes sense to me (push the Send
/ Sync
validation to the Allocation
+1 for cleaning up clippy lint
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Can drop this after rebase on commit 55d6073 "Require Send+Sync bounds for Allocation trait (apache#1945)", first released in 18.0.0
Which issue does this PR close?
Closes #1944.
Rationale for this change
Send + Sync
were previously implemented forBuffer
which probably was not sound in case the underlyingAllocation
was not alsoSend + Sync
.What changes are included in this PR?
Allocation
trait requiresSend + Sync
Bytes
implementsSend + Sync
which should be fine since it only contains aNonNull
pointer in addition to the allocationBuffer
is then automaticallySend + Sync
FFI_ArrowArray
now has to implementSend + Sync
. This requirement was previously hidden by the unsafe impl onBuffer
, even before the introduction of theAllocation
abstraction in Decouple buffer deallocation from ffi and allow creating buffers from rust vec #1494Are there any user-facing changes?
This could be a breaking change for users of the
Allocation
trait, but those usages would have been unsound before.