[−][src]Struct gharial::TestAlloc
TestAlloc
is a implementation for GlobalAlloc
to test memory leak and so on.
It is a wrapper of another GlobalAlloc
, and delegates the requests to the inner after testing.
The checks are followings.
- The argument
*mut u8
passed todealloc
is not null. (The behavior is undefined according toGlobalAlloc
interface.) - The consistency of the argument
Layout
. i.e. the argument passed todealloc
matches to that passed toalloc
having returned the corresponding pointer. - All allocated memories have already been deallocated on the drop. (Note that cloned instances share the allocating memory information. The check is done when the last cloned instance is dropped.)
See also GAlloc
. It is an alias to TestAlloc<std::alloc::System>
.
Trait Implementations
impl<A> Clone for TestAlloc<A> where
A: GlobalAlloc + Clone,
[src]
A: GlobalAlloc + Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A> Debug for TestAlloc<A> where
A: GlobalAlloc + Debug,
[src]
A: GlobalAlloc + Debug,
impl<A> Default for TestAlloc<A> where
A: GlobalAlloc + Default,
[src]
A: GlobalAlloc + Default,
impl<A> Drop for TestAlloc<A> where
A: GlobalAlloc,
[src]
A: GlobalAlloc,
impl<A> From<A> for TestAlloc<A> where
A: GlobalAlloc,
[src]
A: GlobalAlloc,
impl<A> GlobalAlloc for TestAlloc<A> where
A: GlobalAlloc,
[src]
A: GlobalAlloc,
unsafe fn alloc(&self, layout: Layout) -> *mut u8
[src]
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
[src]
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
1.28.0[src]
unsafe fn realloc(
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize
) -> *mut u8
1.28.0[src]
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize
) -> *mut u8
impl<A> Send for TestAlloc<A> where
A: GlobalAlloc + Send,
[src]
A: GlobalAlloc + Send,
impl<A> Sync for TestAlloc<A> where
A: GlobalAlloc + Send + Sync,
[src]
A: GlobalAlloc + Send + Sync,
Auto Trait Implementations
impl<A> RefUnwindSafe for TestAlloc<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
impl<A> Unpin for TestAlloc<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for TestAlloc<A> where
A: UnwindSafe,
A: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,