diff options
| author | Div Shekhar <div@pagerduty.com> | 2014-01-15 22:02:48 -0800 |
|---|---|---|
| committer | Div Shekhar <div@pagerduty.com> | 2014-01-15 22:02:48 -0800 |
| commit | 8f93d39c75ef7964ea1dfb5cd8155dd29e61b76b (patch) | |
| tree | 558e9c99ee4b6525d5a8980f4fbebcc14f2ac0d2 /doc | |
| parent | 065f936bf153f482e10779ebd45b077035a578e0 (diff) | |
| download | rust-8f93d39c75ef7964ea1dfb5cd8155dd29e61b76b.tar.gz rust-8f93d39c75ef7964ea1dfb5cd8155dd29e61b76b.zip | |
doc: add note below diagram about memory layout.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/tutorial.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index 0efe7e3fdf4..057944484ba 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1025,6 +1025,11 @@ box, while the owner holds onto a pointer to it: list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil | +--------------+ +--------------+ +--------------+ +--------------+ +> Note: the above diagram shows the logical contents of the enum. The actual +> memory layout of the enum may vary. For example, for the `List` enum shown +> above, Rust guarantees that there will be no enum tag field in the actual +> structure. See the language reference for more details. + An owned box is a common example of a type with a destructor. The allocated memory is cleaned up when the box is destroyed. |
