File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ Rustc tries to be pretty careful how it manages memory. The compiler allocates
4
4
_ a lot_ of data structures throughout compilation, and if we are not careful,
5
5
it will take a lot of time and space to do so.
6
6
7
- One of the main way the compiler manages this is using arenas and interning.
7
+ One of the main way the compiler manages this is using [ arena] s and [ interning] .
8
+
9
+ [ arena ] : https://en.wikipedia.org/wiki/Region-based_memory_management
10
+ [ interning ] : https://en.wikipedia.org/wiki/String_interning
8
11
9
12
## Arenas and Interning
10
13
Original file line number Diff line number Diff line change @@ -246,12 +246,15 @@ for different purposes:
246
246
optimizations on it.
247
247
248
248
One other thing to note is that many values in the compiler are _ interned_ .
249
- This is a performance and memory optimization in which we allocate the values
250
- in a special allocator called an _ arena_ . Then, we pass around references to
251
- the values allocated in the arena. This allows us to make sure that identical
252
- values (e.g. types in your program) are only allocated once and can be compared
253
- cheaply by comparing pointers. Many of the intermediate representations are
254
- interned.
249
+ This is a performance and memory optimization in which we allocate the values in
250
+ a special allocator called an
251
+ _ [ arena] _ . Then, we pass
252
+ around references to the values allocated in the arena. This allows us to make
253
+ sure that identical values (e.g. types in your program) are only allocated once
254
+ and can be compared cheaply by comparing pointers. Many of the intermediate
255
+ representations are interned.
256
+
257
+ [ arena ] : https://en.wikipedia.org/wiki/Region-based_memory_management
255
258
256
259
### Queries
257
260
You can’t perform that action at this time.
0 commit comments