We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d21c0d1 commit 2621504Copy full SHA for 2621504
book/src/07_threads/03_leak.md
@@ -27,12 +27,12 @@ run out and crash with an out-of-memory error.
27
fn oom_trigger() {
28
loop {
29
let v: Vec<usize> = Vec::with_capacity(1024);
30
- Box::leak(v);
+ v.leak();
31
}
32
33
```
34
35
-At the same time, memory leaked via `Box::leak` is not truly forgotten.\
+At the same time, memory leaked via `leak` method is not truly forgotten.\
36
The operating system can map each memory region to the process responsible for it.
37
When the process exits, the operating system will reclaim that memory.
38
0 commit comments