mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Have worker-local GlobalArenas
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
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 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 @@ fn deref(&self) -> &Self::Target {
|
||||
}
|
||||
|
||||
pub struct GlobalCtxt<'tcx> {
|
||||
global_arenas: &'tcx GlobalArenas<'tcx>,
|
||||
global_arenas: &'tcx WorkerLocal<GlobalArenas<'tcx>>,
|
||||
global_interners: CtxtInterners<'tcx>,
|
||||
|
||||
cstore: &'tcx CrateStoreDyn,
|
||||
|
||||
Reference in New Issue
Block a user