1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-04 08:08:09 +02:00

Add speaker notes for rc.md

This commit is contained in:
Fabian Bornhofen 2023-01-11 14:04:30 +01:00
parent 5256d9c3fd
commit dd194f07c9

View File

@ -22,3 +22,11 @@ context.
[1]: https://doc.rust-lang.org/std/rc/struct.Rc.html
[2]: https://doc.rust-lang.org/std/cell/index.html
[3]: ../concurrency/shared_state/arc.md
<details>
* Like C++'s `std::shared_ptr`.
* `clone` is cheap: creates a pointer to the same allocation and increases the reference count.
* `make_mut` actually clones the inner value if necessary ("clone-on-write") and returns a mutable reference.
</details>