Skip to content

Commit 0c949d8

Browse files
committed
Rollup merge of rust-lang#33743 - royalstream:royalstream-stack-doc, r=steveklabnik
Book: small improvement to a table to make it clearer This table is used as an example of four heap values where two of them got deallocated leaving a gap. It also has stack variables. Instead of four stack variables I propose three, that way there's no misleading connection between the number of stack variables and heap variables. But more importantly: three of the four stack variables had the same name (**y**) which could be confusing to a beginner, I changed this as well.
2 parents 3f4d915 + 519cc82 commit 0c949d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/book/the-stack-and-the-heap.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ And then `bold()` calls `italic()`:
175175
| **2** | **b**|**100**|
176176
| **1** | **a**| **5** |
177177
| 0 | x | 42 |
178+
178179
Whew! Our stack is growing tall.
179180

180181
After `italic()` is over, its frame is deallocated, leaving only `bold()` and
@@ -260,8 +261,7 @@ layout of a program which has been running for a while now:
260261
| (2<sup>30</sup>) - 3 | | |
261262
| (2<sup>30</sup>) - 4 | | 42 |
262263
| ... | ... | ... |
263-
| 3 | y | → (2<sup>30</sup>) - 4 |
264-
| 2 | y | 42 |
264+
| 2 | z | → (2<sup>30</sup>) - 4 |
265265
| 1 | y | 42 |
266266
| 0 | x | → (2<sup>30</sup>) - 1 |
267267

0 commit comments

Comments
 (0)