1
Fork 0

collector: recursively traverse 'mentioned' items to evaluate their constants

This commit is contained in:
Ralf Jung 2024-03-15 21:06:40 +01:00
parent d31b6fb8c0
commit 712fe36611
24 changed files with 641 additions and 142 deletions

View file

@ -20,6 +20,7 @@
//! | ----------------------- | ------------------- | ------------------------------- |
//! | `Lrc<T>` | `rc::Rc<T>` | `sync::Arc<T>` |
//! |` Weak<T>` | `rc::Weak<T>` | `sync::Weak<T>` |
//! | `LRef<'a, T>` [^2] | `&'a mut T` | `&'a T` |
//! | | | |
//! | `AtomicBool` | `Cell<bool>` | `atomic::AtomicBool` |
//! | `AtomicU32` | `Cell<u32>` | `atomic::AtomicU32` |
@ -38,7 +39,7 @@
//! of a `RefCell`. This is appropriate when interior mutability is not
//! required.
//!
//! [^2] `MTLockRef` is a typedef.
//! [^2] `MTRef`, `MTLockRef` are type aliases.
pub use crate::marker::*;
use std::collections::HashMap;
@ -208,7 +209,7 @@ cfg_match! {
use std::cell::RefCell as InnerRwLock;
pub type MTLockRef<'a, T> = &'a mut MTLock<T>;
pub type LRef<'a, T> = &'a mut T;
#[derive(Debug, Default)]
pub struct MTLock<T>(T);
@ -274,7 +275,7 @@ cfg_match! {
pub use std::sync::Arc as Lrc;
pub use std::sync::Weak as Weak;
pub type MTLockRef<'a, T> = &'a MTLock<T>;
pub type LRef<'a, T> = &'a T;
#[derive(Debug, Default)]
pub struct MTLock<T>(Lock<T>);
@ -314,6 +315,8 @@ cfg_match! {
}
}
pub type MTLockRef<'a, T> = LRef<'a, MTLock<T>>;
#[derive(Default)]
#[cfg_attr(parallel_compiler, repr(align(64)))]
pub struct CacheAligned<T>(pub T);