Updated 'src/smart_pointers/rc-t'.

This commit is contained in:
Hector PENG
2026-04-03 18:53:14 +08:00
parent 2062138bd3
commit edcefdcfa8
2 changed files with 2 additions and 5 deletions

View File

@@ -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)

View File

@@ -1,7 +1,4 @@
# `Rc<T>`,引用计数灵巧指针
**`Rc<T>`, the Reference Counted Smart Pointer**
# `Rc<T>`,引用计数灵巧指针
在大多数情况下,所有权是明确的:咱们确切地知道哪个变量拥有给定值。然而,在有些情况下,单个值可能有多个所有者。例如,在图数据结构中,多条边可能指向同一个节点,而该节点在概念上被所有指向他的边所拥有。一个节点不应该被清理,除非没有任何边指向他,因此没有了所有者。