From d402d2d0d4c0f8cbccf52c119666b143adcc35b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20K=C3=A5re=20Alsaker?= Date: Mon, 22 Jan 2018 14:31:23 +0100 Subject: [PATCH] Have worker-local GlobalArenas --- src/librustc/ty/context.rs | 8 ++++---- 1 file 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 @@ 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>, 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>, global_interners: CtxtInterners<'tcx>, cstore: &'tcx CrateStoreDyn, -- 2.44.0