fn drop(&mut self) {
        unsafe {
            let journal = Journal::<A>::current(true).unwrap();
            let j = &*journal.0;
            self.dec_strong(j);
            if self.strong() == 0 { // TODO: Add "or it is unreachable from the root"
                // destroy the contained object
                std::ptr::drop_in_place(&mut self.ptr.as_mut().value);

                self.dec_weak(j);
                if self.weak() == 0 {
                    A::free(self.ptr.as_mut());

                    #[cfg(not(feature = "no_volatile_pointers"))]
                    std::ptr::drop_in_place(&mut self.ptr.as_mut().vlist);
                }
            }
        }
    }
/// Drops the `Prc` safely
///
/// This will decrement the strong reference count. If the strong reference
/// count reaches zero then the only other references (if any) are
/// `Weak`, so we `drop` the inner value on commit using a `DropOnCommit` log.
///
/// # Examples
///
/// ```
/// # use corundum::alloc::heap::*;
/// # type P = Heap;
/// use corundum::prc::Prc;
/// use corundum::clone::PClone;
///
/// struct Foo;
///
/// impl Drop for Foo {
///     fn drop(&mut self) {
///         println!("dropped!");
///     }
/// }
///
/// P::transaction(|j| {
///     let foo  = Prc::new(Foo, j);
///     let foo2 = Prc::pclone(&foo, j);
///
///     drop(foo);    // Doesn't print anything
///     drop(foo2);   // Prints "dropped!"
/// }).unwrap();
/// ```
///
Drops the `Prc` safely
This will decrement the strong reference count.
Drops the ` Prc ` safely This will decrement the strong reference count .
fn drop(&mut self) {
        unsafe {
            let journal = Journal::<A>::current(true).unwrap();
            let j = &*journal.0;
            self.dec_strong(j);
            if self.strong() == 0 { // TODO: Add "or it is unreachable from the root"
                // destroy the contained object
                std::ptr::drop_in_place(&mut self.ptr.as_mut().value);
                self.dec_weak(j);
                if self.weak() == 0 {
                    A::free(self.ptr.as_mut());
                    #[cfg(not(feature = "no_volatile_pointers"))]
                    std::ptr::drop_in_place(&mut self.ptr.as_mut().vlist);
                }
            }
        }
    }
fn drop ( & mut self ) { unsafe { let journal = Journal :: < A > :: current ( true ) . unwrap ( ) ; let j = & * journal . 0 ; self . dec_strong ( j ) ; if self . strong ( ) == 0 { // TODO: Add "or it is unreachable from the root" // destroy the contained object std :: ptr :: drop_in_place ( & mut self . ptr . as_mut ( ) . value ) ; self . dec_weak ( j ) ; if self . weak ( ) == 0 { A :: free ( self . ptr . as_mut ( ) ) ; # [ cfg ( not ( feature " " ) ) ] std :: ptr :: drop_in_place ( & mut self . ptr . as_mut ( ) . vlist ) ; } } } }
Drops the `Prc` safely
This will decrement the strong reference count.
Drops the ` Prc ` safely This will decrement the strong reference count .
&mut self
examples
None
use corundum::alloc::heap::*;
None
type p = heap;
use corundum::prc::Prc;
use corundum::clone::PClone.

struct Foo.

impl Drop for Foo {
fn drop(&mut self) {
println!("dropped!");
}
}

:transaction(|j| {
let foo  = Prc::new(Foo, j);
let foo2 = Prc::pclone(&foo, j).

drop(foo);    // Doesn't print anything
drop(foo2);   // Prints "dropped!"
}).unwrap();
```
use corundum :: prc :: Prc ; use corundum :: clone :: PClone . struct Foo . impl Drop for Foo { fn drop ( &mut self ) { println! ( " dropped! " ) ; } } : transaction ( |j| { let foo = Prc :: new ( Foo j ) ; let foo2 = Prc :: pclone ( &foo j ) . drop ( foo ) ; // Doesn ' t print anything drop ( foo2 ) ; // Prints " dropped! " } ) . unwrap () ; ` ` `