#[cfg(all(feature = "alloc", not(target_has_atomic = "ptr")))]
pub(crate) use portable_atomic_util::Arc;
#[cfg(all(feature = "alloc", target_has_atomic = "ptr"))]
pub(crate) use alloc::sync::Arc;
#[cfg(not(feature = "alloc"))]
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct Arc<T>(T);
#[cfg(not(feature = "alloc"))]
impl<T> Arc<T> {
pub(crate) fn new(t: T) -> Arc<T> {
Arc(t)
}
pub(crate) fn get_mut(this: &mut Arc<T>) -> Option<&mut T> {
Some(&mut this.0)
}
}
#[cfg(not(feature = "alloc"))]
impl<T> core::ops::Deref for Arc<T> {
type Target = T;
fn deref(&self) -> &T {
&self.0
}
}