Skip to content

Commit

Permalink
Minor grammar change in src/std/rc.md paragraph 2 (#1586)
Browse files Browse the repository at this point in the history
Co-authored-by: David Niedzielski <david.niedzielski@tomtom.com>
  • Loading branch information
nw31304 and davidniedzielski-tomtom authored Jul 26, 2022
1 parent d950242 commit f192719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/std/rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

When multiple ownership is needed, `Rc`(Reference Counting) can be used. `Rc` keeps track of the number of the references which means the number of owners of the value wrapped inside an `Rc`.

Reference count of an `Rc` increases by 1 whenever an `Rc` is cloned, and decreases by 1 whenever one cloned `Rc` is dropped out of the scope. When an `Rc`'s reference count becomes zero, which means there are no owners remained, both the `Rc` and the value are all dropped.
Reference count of an `Rc` increases by 1 whenever an `Rc` is cloned, and decreases by 1 whenever one cloned `Rc` is dropped out of the scope. When an `Rc`'s reference count becomes zero (which means there are no remaining owners), both the `Rc` and the value are all dropped.

Cloning an `Rc` never performs a deep copy. Cloning creates just another pointer to the wrapped value, and increments the count.

Expand Down

0 comments on commit f192719

Please sign in to comment.