From 22eb466dfd38bb9c8063bd37054baf2e47092b97 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 13 May 2015 16:43:39 -0400 Subject: [PATCH] Fix typo Thanks apdapreturns --- src/doc/trpl/the-stack-and-the-heap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/trpl/the-stack-and-the-heap.md b/src/doc/trpl/the-stack-and-the-heap.md index 7b1cd7dc8093b..f5654d6293991 100644 --- a/src/doc/trpl/the-stack-and-the-heap.md +++ b/src/doc/trpl/the-stack-and-the-heap.md @@ -266,7 +266,7 @@ Rust programs use [jemalloc][jemalloc] for this purpose. Anyway, back to our example. Since this memory is on the heap, it can stay alive longer than the function which allocates the box. In this case, however, it doesn’t.[^moving] When the function is over, we need to free the stack frame -for `main()`. `Box`, though, has a trick up its sleve: [Drop][drop]. The +for `main()`. `Box`, though, has a trick up its sleeve: [Drop][drop]. The implementation of `Drop` for `Box` deallocates the memory that was allocated when it was created. Great! So when `x` goes away, it first frees the memory allocated on the heap: