Trait mbox::free::Free

source ·
pub trait Free {
    // Required method
    unsafe fn free(ptr: NonNull<Self>);
}
Expand description

Implemented for pointers which can be freed.

Required Methods§

source

unsafe fn free(ptr: NonNull<Self>)

Drops the content pointed by this pointer and frees it.

§Safety

The ptr must be allocated through malloc().

Do not call this method if the pointer has been freed. Users of this trait should maintain a flag to track if the pointer has been freed or not (the Rust compiler will automatically do this with a Drop type).

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Free for str

source§

unsafe fn free(fat_ptr: NonNull<Self>)

source§

impl<T> Free for [T]

source§

unsafe fn free(fat_ptr: NonNull<Self>)

Implementors§

source§

impl<T> Free for T