pub fn new(x: T, journal: &Journal<A>) -> Pbox<T, A> {
        if mem::size_of::<T>() == 0 {
            Pbox(Ptr::dangling(), 0)
        } else {
            unsafe {
                let p = A::new(x, journal);
                Pbox(Ptr::from_mut(p), 0)
            }
        }
    }
/// Allocates memory on the persistent heap and then places `x` into it.
///
/// This doesn't actually allocate if `T` is zero-sized.
///
/// # Examples
///
/// ```
/// # use corundum::alloc::heap::*;
/// # use corundum::boxed::Pbox;
/// Heap::transaction(|j| {
///     let five = Pbox::new(5, j);
/// }).unwrap();
/// ```
Allocates memory on the persistent heap and then places `x` into it.
This doesn't actually allocate if `T` is zero-sized.
Allocates memory on the persistent heap and then places ` x ` into it . This doesn ' t actually allocate if ` T ` is zero - sized .
pub fn new(x: T, journal: &Journal<A>) -> Pbox<T, A> {
        if mem::size_of::<T>() == 0 {
            Pbox(Ptr::dangling(), 0)
        } else {
            unsafe {
                let p = A::new(x, journal);
                Pbox(Ptr::from_mut(p), 0)
            }
        }
    }
pub fn new ( x : T , journal : & Journal < A > ) -> Pbox < T , A > { if mem :: size_of :: < T > ( ) == 0 { Pbox ( Ptr :: dangling ( ) , 0 ) } else { unsafe { let p = A :: new ( x , journal ) ; Pbox ( Ptr :: from_mut ( p ) , 0 ) } } }
Allocates memory on the persistent heap and then places `x` into it.
Allocates memory on the persistent heap and then places ` x ` into it .
x
T
journal
&Journal<A>
examples
None
use corundum::alloc::heap::*;
None
use corundum::boxed::pbox;
None