diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 8aaf2d7..d16d7be 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -93,7 +93,7 @@ - [灵巧指针](Ch15_Smart_Pointers.md) - [使用 `Box` 指向内存堆上的数据](smart_pointers/box-t.md) - [将灵巧指针视为普通引用](smart_pointers/deref-t.md) - - [使用 `Drop` 特质在内存清理时运行代码](smart_pointers/drop-t.md) + - [通过 `Drop` 特质在内存清理时运行代码](smart_pointers/drop-t.md) - [引用有计数的灵巧指针 `Rc`](smart_pointers/rc-t.md) - [`RefCell` 与内部可变性模式](smart_pointers/refcell-t.md) - [引用循环会泄露内存](smart_pointers/ref-cycles.md) diff --git a/src/smart_pointers/rc-t.md b/src/smart_pointers/rc-t.md index aad588f..6f8c7aa 100644 --- a/src/smart_pointers/rc-t.md +++ b/src/smart_pointers/rc-t.md @@ -1,7 +1,4 @@ -# `Rc`,引用计数灵巧指针 - -**`Rc`, the Reference Counted Smart Pointer** - +# `Rc`,引用计数的灵巧指针 在大多数情况下,所有权是明确的:咱们确切地知道哪个变量拥有给定值。然而,在有些情况下,单个值可能有多个所有者。例如,在图数据结构中,多条边可能指向同一个节点,而该节点在概念上被所有指向他的边所拥有。一个节点不应该被清理,除非没有任何边指向他,因此没有了所有者。