-
Notifications
You must be signed in to change notification settings - Fork 13.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
Explicate what "Rc" and "Arc" stand for. #42419
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/liballoc/rc.rs
Outdated
@@ -10,7 +10,8 @@ | |||
|
|||
#![allow(deprecated)] | |||
|
|||
//! Single-threaded reference-counting pointers. | |||
//! Single-threaded reference-counting pointers. "Rc" stands for "Reference |
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 think of Rc as "reference counted", not "reference counter" personally, and Arc as "atomically reference counted".
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.
After reflection, I was reaching the same conclusion. I'll fix the PR.
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.
When I compare "atomically reference-counted" with "atomic reference counter," the tech-jargon-ness of the former seems a bit stronger than that of the latter. Just my personal impression.
@rust-lang/docs |
27b4e40
to
8d9df99
Compare
Yes, the latter is correct.
That might be a good idea, yes 😄 |
src/liballoc/arc.rs
Outdated
@@ -42,7 +42,8 @@ use heap::deallocate; | |||
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references. | |||
const MAX_REFCOUNT: usize = (isize::MAX) as usize; | |||
|
|||
/// A thread-safe reference-counting pointer. | |||
/// A thread-safe reference-counting pointer. "Arc" stands for "Atomically |
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.
Both of these should be single quotes
@steveklabnik I misspoke -- I had added those docs to the |
This looks great, thanks! @bors r+ rollup |
📌 Commit 1af0cb1 has been approved by |
Explicate what "Rc" and "Arc" stand for. A person on the weekly "Easy Questions" Reddit thread [was mystified by what `Arc`/`Rc` means](https://www.reddit.com/r/rust/comments/6dyud9/hey_rustaceans_got_an_easy_question_ask_here/did87ds/). Though this is explained in various places, it's not mentioned in the documentation directly. This PR adds an explanation of the `Rc`/`Arc` acronyms to their respective documentations. There are two things I'm not sure of: * Does "Rc" mean "Reference Count**er**" or "Reference Count**ed**"? ~~I went with the former.~~ *Edit:* I've changed this to use the latter alternative. * Should this information be spelled out elsewhere, such as in the docs for the `rc` module?
☀️ Test successful - status-appveyor, status-travis |
A person on the weekly "Easy Questions" Reddit thread was mystified by what
Arc
/Rc
means. Though this is explained in various places, it's not mentioned in the documentation directly.This PR adds an explanation of the
Rc
/Arc
acronyms to their respective documentations. There are two things I'm not sure of:I went with the former.Edit: I've changed this to use the latter alternative.rc
module?