pub fn new(value: T, journal: &Journal<A>) -> Prc<T, A> {
        unsafe {
            let ptr = Ptr::new_unchecked(A::new(
                PrcBox::<T, A> {
                    counter: Counter {
                        strong: 1,
                        weak: 1,

                        #[cfg(not(any(
                            feature = "no_log_rc",
                            feature = "use_pspd",
                            feature = "use_vspd"
                        )))]
                        has_log: 0,

                        #[cfg(any(feature = "use_pspd", feature = "use_vspd"))]
                        temp: TCell::new_invalid(None),

                        phantom: PhantomData
                    },

                    #[cfg(not(feature = "no_volatile_pointers"))]
                    vlist: VCell::new(VWeakList::default()),

                    dummy: [],
                    value,
                },
                journal,
            ));
            Self::from_inner(ptr)
        }
    }
/// Constructs a new `Prc<T>`.
///
/// It also creates a `DropOnFailure` log to make sure that if the program
/// crashes, the allocation drops of recovery.
///
/// # Examples
///
/// ```
/// # use corundum::alloc::heap::*;
/// # type P = Heap;
/// use corundum::prc::Prc;
///
/// P::transaction(|j| {
///     let five = Prc::new(5, j);
/// }).unwrap();
/// ```
Constructs a new `Prc`.
It also creates a `DropOnFailure` log to make sure that if the program
crashes, the allocation drops of recovery.
Constructs a new ` Prc ` . It also creates a ` DropOnFailure ` log to make sure that if the program crashes the allocation drops of recovery .
pub fn new(value: T, journal: &Journal<A>) -> Prc<T, A> {
        unsafe {
            let ptr = Ptr::new_unchecked(A::new(
                PrcBox::<T, A> {
                    counter: Counter {
                        strong: 1,
                        weak: 1,
                        #[cfg(not(any(
                            feature = "no_log_rc",
                            feature = "use_pspd",
                            feature = "use_vspd"
                        )))]
                        has_log: 0,
                        #[cfg(any(feature = "use_pspd", feature = "use_vspd"))]
                        temp: TCell::new_invalid(None),
                        phantom: PhantomData
                    },
                    #[cfg(not(feature = "no_volatile_pointers"))]
                    vlist: VCell::new(VWeakList::default()),
                    dummy: [],
                    value,
                },
                journal,
            ));
            Self::from_inner(ptr)
        }
    }
pub fn new ( value : T , journal : & Journal < A > ) -> Prc < T , A > { unsafe { let ptr = Ptr :: new_unchecked ( A :: new ( PrcBox :: < T , A > { counter : Counter { strong : 1 , weak : 1 , # [ cfg ( not ( any ( feature " " feature " " feature " " ) ) ) ] has_log : 0 , # [ cfg ( any ( feature " " feature " " ) ) ] temp : TCell :: new_invalid ( None ) , phantom : PhantomData } , # [ cfg ( not ( feature " " ) ) ] vlist : VCell :: new ( VWeakList :: default ( ) ) , dummy : [ ] , value , } , journal , ) ) ; Self :: from_inner ( ptr ) } }
Constructs a new `Prc<T>`.
Constructs a new ` Prc<T > ` .
value
T
journal
&Journal<A>
examples
None
use corundum::alloc::heap::*;
None
type p = heap;
None