diff options
| author | Arthur Milchior <arthur@milchior.fr> | 2024-01-29 20:55:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-30 04:55:16 +0900 |
| commit | d4d56790289f12244377bb61c0fc69569e6b43b2 (patch) | |
| tree | ca9b16a178753475db7ae20bb977892e04486bd3 /src/doc/rustc-dev-guide | |
| parent | 40dd7f25959487c25d8fa1c2d52ec5637051046c (diff) | |
| download | rust-d4d56790289f12244377bb61c0fc69569e6b43b2.tar.gz rust-d4d56790289f12244377bb61c0fc69569e6b43b2.zip | |
Add links for arena and interning. (#1868)
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/memory.md | 5 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/overview.md | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/doc/rustc-dev-guide/src/memory.md b/src/doc/rustc-dev-guide/src/memory.md index 4072d4f33c6..e46a4a2835a 100644 --- a/src/doc/rustc-dev-guide/src/memory.md +++ b/src/doc/rustc-dev-guide/src/memory.md @@ -4,7 +4,10 @@ Rustc tries to be pretty careful how it manages memory. The compiler allocates _a lot_ of data structures throughout compilation, and if we are not careful, it will take a lot of time and space to do so. -One of the main way the compiler manages this is using arenas and interning. +One of the main way the compiler manages this is using [arena]s and [interning]. + +[arena]: https://en.wikipedia.org/wiki/Region-based_memory_management +[interning]: https://en.wikipedia.org/wiki/String_interning ## Arenas and Interning diff --git a/src/doc/rustc-dev-guide/src/overview.md b/src/doc/rustc-dev-guide/src/overview.md index 797f4d8e293..fb0b07e6305 100644 --- a/src/doc/rustc-dev-guide/src/overview.md +++ b/src/doc/rustc-dev-guide/src/overview.md @@ -246,12 +246,15 @@ for different purposes: optimizations on it. One other thing to note is that many values in the compiler are _interned_. -This is a performance and memory optimization in which we allocate the values -in a special allocator called an _arena_. Then, we pass around references to -the values allocated in the arena. This allows us to make sure that identical -values (e.g. types in your program) are only allocated once and can be compared -cheaply by comparing pointers. Many of the intermediate representations are -interned. +This is a performance and memory optimization in which we allocate the values in +a special allocator called an +_[arena]_. Then, we pass +around references to the values allocated in the arena. This allows us to make +sure that identical values (e.g. types in your program) are only allocated once +and can be compared cheaply by comparing pointers. Many of the intermediate +representations are interned. + +[arena]: https://en.wikipedia.org/wiki/Region-based_memory_management ### Queries |
