Skip to content

Commit d402d2d

Browse files
committed
Have worker-local GlobalArenas
1 parent 969296b commit d402d2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/ty/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use rustc_data_structures::stable_hasher::{HashStable, hash_stable_hashmap,
5858
StableVec};
5959
use arena::{TypedArena, SyncDroplessArena};
6060
use rustc_data_structures::indexed_vec::IndexVec;
61-
use rustc_data_structures::sync::{Lrc, Lock};
61+
use rustc_data_structures::sync::{Lrc, Lock, WorkerLocal};
6262
use std::any::Any;
6363
use std::borrow::Borrow;
6464
use std::cmp::Ordering;
@@ -80,14 +80,14 @@ use syntax_pos::Span;
8080
use hir;
8181

8282
pub struct AllArenas<'tcx> {
83-
pub global: GlobalArenas<'tcx>,
83+
pub global: WorkerLocal<GlobalArenas<'tcx>>,
8484
pub interner: SyncDroplessArena,
8585
}
8686

8787
impl<'tcx> AllArenas<'tcx> {
8888
pub fn new() -> Self {
8989
AllArenas {
90-
global: GlobalArenas::new(),
90+
global: WorkerLocal::new(|_| GlobalArenas::new()),
9191
interner: SyncDroplessArena::new(),
9292
}
9393
}
@@ -854,7 +854,7 @@ impl<'a, 'gcx, 'tcx> Deref for TyCtxt<'a, 'gcx, 'tcx> {
854854
}
855855

856856
pub struct GlobalCtxt<'tcx> {
857-
global_arenas: &'tcx GlobalArenas<'tcx>,
857+
global_arenas: &'tcx WorkerLocal<GlobalArenas<'tcx>>,
858858
global_interners: CtxtInterners<'tcx>,
859859

860860
cstore: &'tcx CrateStoreDyn,

0 commit comments

Comments
 (0)