1
Fork 0

Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structures

This commit is contained in:
John Kåre Alsaker 2020-10-31 12:01:54 +01:00
parent c6fb7b9815
commit 64474a40b0
5 changed files with 213 additions and 34 deletions

View file

@ -1,14 +1,10 @@
use crate::fx::{FxHashMap, FxHasher};
use crate::sync::{Lock, LockGuard};
use crate::sync::{CacheAligned, Lock, LockGuard};
use std::borrow::Borrow;
use std::collections::hash_map::RawEntryMut;
use std::hash::{Hash, Hasher};
use std::mem;
#[derive(Default)]
#[cfg_attr(parallel_compiler, repr(align(64)))]
struct CacheAligned<T>(T);
#[cfg(parallel_compiler)]
// 32 shards is sufficient to reduce contention on an 8-core Ryzen 7 1700,
// but this should be tested on higher core count CPUs. How the `Sharded` type gets used