File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 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
44_ a lot_  of data structures throughout compilation, and if we are not careful,
55it will take a lot of time and space to do so.
66
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 
811
912## Arenas and  Interning  
1013
Original file line number Diff line number Diff line change @@ -246,12 +246,15 @@ for different purposes:
246246  optimizations on it.
247247
248248One 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 
255258
256259### Queries  
257260
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments