diff --git a/src/SUMMARY.md b/src/SUMMARY.md index d5bba7c2040..160efc7ae83 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -85,7 +85,6 @@ - [Scope-Based Memory Management](memory-management/scope-based.md) - [Garbage Collection](memory-management/garbage-collection.md) - [Rust Memory Management](memory-management/rust.md) - - [Comparison](memory-management/comparison.md) - [Ownership](ownership.md) - [Move Semantics](ownership/move-semantics.md) - [Moved Strings in Rust](ownership/moved-strings-rust.md) diff --git a/src/memory-management/comparison.md b/src/memory-management/comparison.md deleted file mode 100644 index 373abff0b65..00000000000 --- a/src/memory-management/comparison.md +++ /dev/null @@ -1,35 +0,0 @@ -# Comparison - -Here is a rough comparison of the memory management techniques. - -## Pros of Different Memory Management Techniques - -* Manual like C: - * No runtime overhead. -* Automatic like Java: - * Fully automatic. - * Safe and correct. -* Scope-based like C++: - * Partially automatic. - * No runtime overhead. -* Compiler-enforced scope-based like Rust: - * Enforced by compiler. - * No runtime overhead. - * Safe and correct. - -## Cons of Different Memory Management Techniques - -* Manual like C: - * Use-after-free. - * Double-frees. - * Memory leaks. -* Automatic like Java: - * Garbage collection pauses. - * Destructor delays. -* Scope-based like C++: - * Complex, opt-in by programmer (on C++). - * Circular references can lead to memory leaks - * Potential runtime overhead -* Compiler-enforced and scope-based like Rust: - * Some upfront complexity. - * Can reject valid programs. diff --git a/src/memory-management/rust.md b/src/memory-management/rust.md index a231234e0a7..7d822391842 100644 --- a/src/memory-management/rust.md +++ b/src/memory-management/rust.md @@ -3,7 +3,6 @@ Memory management in Rust is a mix: * Safe and correct like Java, but without a garbage collector. -* Depending on which abstraction (or combination of abstractions) you choose, can be a single unique pointer, reference counted, or atomically reference counted. * Scope-based like C++, but the compiler enforces full adherence. * A Rust user can choose the right abstraction for the situation, some even have no cost at runtime like C.