about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-01-22 14:31:23 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-06-01 14:57:08 +0200
commitd402d2d0d4c0f8cbccf52c119666b143adcc35b3 (patch)
tree7f723468ba94b6ac666ec1403a0f880a012e8440
parent969296b79b22363c67b1e6786bd115ced881210f (diff)
downloadrust-d402d2d0d4c0f8cbccf52c119666b143adcc35b3.tar.gz
rust-d402d2d0d4c0f8cbccf52c119666b143adcc35b3.zip
Have worker-local GlobalArenas
-rw-r--r--src/librustc/ty/context.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index 0facbc6922a..27cc9514e65 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -58,7 +58,7 @@ use rustc_data_structures::stable_hasher::{HashStable, hash_stable_hashmap,
                                            StableVec};
 use arena::{TypedArena, SyncDroplessArena};
 use rustc_data_structures::indexed_vec::IndexVec;
-use rustc_data_structures::sync::{Lrc, Lock};
+use rustc_data_structures::sync::{Lrc, Lock, WorkerLocal};
 use std::any::Any;
 use std::borrow::Borrow;
 use std::cmp::Ordering;
@@ -80,14 +80,14 @@ use syntax_pos::Span;
 use hir;
 
 pub struct AllArenas<'tcx> {
-    pub global: GlobalArenas<'tcx>,
+    pub global: WorkerLocal<GlobalArenas<'tcx>>,
     pub interner: SyncDroplessArena,
 }
 
 impl<'tcx> AllArenas<'tcx> {
     pub fn new() -> Self {
         AllArenas {
-            global: GlobalArenas::new(),
+            global: WorkerLocal::new(|_| GlobalArenas::new()),
             interner: SyncDroplessArena::new(),
         }
     }
@@ -854,7 +854,7 @@ impl<'a, 'gcx, 'tcx> Deref for TyCtxt<'a, 'gcx, 'tcx> {
 }
 
 pub struct GlobalCtxt<'tcx> {
-    global_arenas: &'tcx GlobalArenas<'tcx>,
+    global_arenas: &'tcx WorkerLocal<GlobalArenas<'tcx>>,
     global_interners: CtxtInterners<'tcx>,
 
     cstore: &'tcx CrateStoreDyn,