mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2026-08-19 12:43:28 +08:00
Updated 'src/smart_pointers/rc-t'.
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
- [灵巧指针](Ch15_Smart_Pointers.md)
|
||||
- [使用 `Box<T>` 指向内存堆上的数据](smart_pointers/box-t.md)
|
||||
- [将灵巧指针视为普通引用](smart_pointers/deref-t.md)
|
||||
- [使用 `Drop` 特质在内存清理时运行代码](smart_pointers/drop-t.md)
|
||||
- [通过 `Drop` 特质在内存清理时运行代码](smart_pointers/drop-t.md)
|
||||
- [引用有计数的灵巧指针 `Rc<T>`](smart_pointers/rc-t.md)
|
||||
- [`RefCell<T>` 与内部可变性模式](smart_pointers/refcell-t.md)
|
||||
- [引用循环会泄露内存](smart_pointers/ref-cycles.md)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
# `Rc<T>`,引用计数灵巧指针
|
||||
|
||||
**`Rc<T>`, the Reference Counted Smart Pointer**
|
||||
|
||||
# `Rc<T>`,引用计数的灵巧指针
|
||||
|
||||
在大多数情况下,所有权是明确的:咱们确切地知道哪个变量拥有给定值。然而,在有些情况下,单个值可能有多个所有者。例如,在图数据结构中,多条边可能指向同一个节点,而该节点在概念上被所有指向他的边所拥有。一个节点不应该被清理,除非没有任何边指向他,因此没有了所有者。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user