From c30bd97149768448ff19b164c44e41901ea82d54 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Sat, 25 Nov 2023 00:17:05 -0500 Subject: [PATCH] still line breaks --- lectures/25_garbage_collection/README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lectures/25_garbage_collection/README.md b/lectures/25_garbage_collection/README.md index bc8aac4..f7be8ff 100644 --- a/lectures/25_garbage_collection/README.md +++ b/lectures/25_garbage_collection/README.md @@ -150,18 +150,18 @@ stack: - Stop & Copy: - – requires a long pause in program execution - + can handle cyclical data structures! - – requires 100% extra memory (you can only use half the memory) - + runs fast if most of the memory is garbage (it only touches the nodes reachable from the root) - + data is clustered together and memory is “de-fragmented” + – - requires a long pause in program execution + - \+ can handle cyclical data structures! + - – requires 100% extra memory (you can only use half the memory) + - \+ runs fast if most of the memory is garbage (it only touches the nodes reachable from the root) + - \+ data is clustered together and memory is “de-fragmented” - Mark-Sweep: - – requires a long pause in program execution - + can handle cyclical data structures! - + requires ∼1% extra memory (just one bit per node) - – runs the same speed regardless of how much of memory is garbage. + – - requires a long pause in program execution + - \+ can handle cyclical data structures! + - \+ requires ∼1% extra memory (just one bit per node) + – - runs the same speed regardless of how much of memory is garbage. It must touch all nodes in the mark phase, and must link together all garbage nodes into a free list. ## 25.11 Practical Garbage Collection Methodology in C++: Smart Pointers @@ -172,6 +172,7 @@ also when we are developing big complex programs that process and rearrange lots enormous beast of a programming language (but that doesn’t stop people from trying!). So is there anything we can do? Yes, we can use Smart Pointers to gain some of the features of garbage collection. Some examples below are modified from these nice online references: + [http://ootips.org/yonat/4dev/smart-pointers.html](http://ootips.org/yonat/4dev/smart-pointers.html) [http://www.codeproject.com/KB/stl/boostsmartptr.aspx](http://www.codeproject.com/KB/stl/boostsmartptr.aspx)