-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: impl Send for InnerStarReference for clippy #80
Conversation
@@ -24,6 +24,7 @@ struct InnerStarReference { | |||
header_view: HeaderView, | |||
} | |||
|
|||
unsafe impl Send for InnerStarReference {} |
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.
We may want to leave a comment here that this is currently only known to be safe because cellranger runs the destructor on the same thread that creates it.
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.
init_star_ref
calls new StarRef
and destroy_ref
calls delete StarRef
orbit/star-sys/STAR/source/orbit.cpp
Lines 116 to 130 in bc050dd
const StarRef* init_star_ref(int argc, const char* const argv[]) { | |
return new StarRef(argc, argv); | |
} | |
Aligner* init_aligner_from_ref(const StarRef* sr) { | |
return new Aligner(sr); | |
} | |
void destroy_aligner(Aligner *a) { | |
delete a; | |
} | |
void destroy_ref(const StarRef* sr) { | |
delete sr; | |
} |
Chris wrote…
If there's no thread-scoped data magic going on, it's probably safe
I'm still a little confused here about why you need reference counting at all here. Why not just use e.g. a |
Given that this underlying object is now marked |
Adam wrote…
Chris wrote in Slack…
I replied… Passing around the STAR reference by reference makes sense to me, since access to it ought to be read only. I'll leave that to another PR though. My aim with this PR to clean up the Clippy lint with a minimal change to permit bumping |
`impl Send for InnerStarReference` to fix the clippy lint: Error: error: usage of an `Arc` that is not `Send` and `Sync`
e4aa77e
to
7c5bf5e
Compare
I've removed the unused Removing |
impl Send for InnerStarReference
to fix the clippy lint:impl Send for StarRef
RUST_VERSION
from 1.65.0 to 1.79.0Fix the clippy lint:
See https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync