Auto merge of #109117 - oli-obk:locks, r=michaelwoerister
Avoid a few locks We can use atomics or datastructures tuned for specific access patterns instead of locks. This may be an improvement for parallel rustc, but it's mostly a cleanup making various datastructures only usable in the way they are used right now (append data, never mutate), instead of having a general purpose lock.
This commit is contained in:
commit
383c1d729e
17 changed files with 137 additions and 47 deletions
|
@ -263,7 +263,8 @@ impl AllocDecodingState {
|
|||
}
|
||||
|
||||
pub fn new(data_offsets: Vec<u32>) -> Self {
|
||||
let decoding_state = vec![Lock::new(State::Empty); data_offsets.len()];
|
||||
let decoding_state =
|
||||
std::iter::repeat_with(|| Lock::new(State::Empty)).take(data_offsets.len()).collect();
|
||||
|
||||
Self { decoding_state, data_offsets }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue