pub struct SecureAlloc;
Expand description
An allocator which obtains a discrete number of virtual memory pages.
The virutal memory pages are flagged using mlock
(VirtualLock
on
Windows) in order to restrict them to physical memory. When the
allocation is released, the allocated memory is securely zeroed.
Trait Implementations§
Source§impl Allocator for SecureAlloc
impl Allocator for SecureAlloc
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Try to allocate a slice of memory within this allocator instance,
returning the new allocation.
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
Release an allocation produced by this allocator. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Try to allocate a slice of memory within this allocator instance,
returning the new allocation. The memory will be initialized with zeroes.
Source§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Try to extend the size of an allocation to accomodate a new, larger layout.
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Try to extend the size of an allocation to accomodate a new, larger layout.
Fill the extra capacity with zeros.
Source§impl AllocatorDefault for SecureAlloc
impl AllocatorDefault for SecureAlloc
Source§impl Clone for SecureAlloc
impl Clone for SecureAlloc
Source§fn clone(&self) -> SecureAlloc
fn clone(&self) -> SecureAlloc
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SecureAlloc
impl Debug for SecureAlloc
Source§impl Default for SecureAlloc
impl Default for SecureAlloc
Source§fn default() -> SecureAlloc
fn default() -> SecureAlloc
Returns the “default value” for a type. Read more
Source§impl PartialEq for SecureAlloc
impl PartialEq for SecureAlloc
impl AllocatorZeroizes for SecureAlloc
impl Copy for SecureAlloc
impl Eq for SecureAlloc
impl StructuralPartialEq for SecureAlloc
Auto Trait Implementations§
impl Freeze for SecureAlloc
impl RefUnwindSafe for SecureAlloc
impl Send for SecureAlloc
impl Sync for SecureAlloc
impl Unpin for SecureAlloc
impl UnwindSafe for SecureAlloc
Blanket Implementations§
Source§impl<A> AllocateIn for Awhere
A: Allocator,
impl<A> AllocateIn for Awhere
A: Allocator,
Source§fn allocate_in(
self,
layout: Layout,
) -> Result<(NonNull<[u8]>, <A as AllocateIn>::Alloc), AllocError>
fn allocate_in( self, layout: Layout, ) -> Result<(NonNull<[u8]>, <A as AllocateIn>::Alloc), AllocError>
Try to allocate a slice of a memory corresponding to
layout
, returning
the new allocation and the allocator instanceSource§fn allocate_zeroed_in(
self,
layout: Layout,
) -> Result<(NonNull<[u8]>, <A as AllocateIn>::Alloc), AllocError>
fn allocate_zeroed_in( self, layout: Layout, ) -> Result<(NonNull<[u8]>, <A as AllocateIn>::Alloc), AllocError>
Try to allocate a slice of a memory corresponding to
layout
, returning
the new allocation and the allocator instance. The memory will be initialized
with zeroes.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, A> ToOwnedIn<A> for T
impl<T, A> ToOwnedIn<A> for T
Source§fn try_to_owned_in<I>(
&self,
_alloc_in: I,
) -> Result<<T as ToOwnedIn<A>>::Owned, StorageError>where
I: AllocateIn<Alloc = A>,
fn try_to_owned_in<I>(
&self,
_alloc_in: I,
) -> Result<<T as ToOwnedIn<A>>::Owned, StorageError>where
I: AllocateIn<Alloc = A>,
To to create an owned copy of this instance in a given allocation target.
Source§fn to_owned_in<I>(&self, alloc_in: I) -> Self::Ownedwhere
I: AllocateIn<Alloc = A>,
fn to_owned_in<I>(&self, alloc_in: I) -> Self::Ownedwhere
I: AllocateIn<Alloc = A>,
Create an owned copy of this instance in a given allocation target.
Source§impl<T, A> VecConfigAlloc<T> for Awhere
A: Allocator,
impl<T, A> VecConfigAlloc<T> for Awhere
A: Allocator,
Source§fn allocator(
buf: &<A as VecConfig>::Buffer<T>,
) -> &<A as VecConfigAlloc<T>>::Alloc
fn allocator( buf: &<A as VecConfig>::Buffer<T>, ) -> &<A as VecConfigAlloc<T>>::Alloc
Get a reference to the allocator instance.
Source§impl<T, A> VecConfigNew<T> for Awhere
A: AllocatorDefault,
impl<T, A> VecConfigNew<T> for Awhere
A: AllocatorDefault,
Source§const EMPTY_BUFFER: <A as VecConfig>::Buffer<T> = FatBuffer<T, VecHeader<usize>, A>::DEFAULT
const EMPTY_BUFFER: <A as VecConfig>::Buffer<T> = FatBuffer<T, VecHeader<usize>, A>::DEFAULT
Constant initializer for an empty buffer.
Source§fn buffer_try_new(
capacity: <A as VecConfig>::Index,
exact: bool,
) -> Result<<A as VecConfig>::Buffer<T>, StorageError>
fn buffer_try_new( capacity: <A as VecConfig>::Index, exact: bool, ) -> Result<<A as VecConfig>::Buffer<T>, StorageError>
Try to create a new buffer instance with a given capacity.
Source§impl<T, A> VecConfigSpawn<T> for A
impl<T, A> VecConfigSpawn<T> for A
Source§impl<T, C> VecNewIn<T> for Cwhere
C: AllocateIn,
impl<T, C> VecNewIn<T> for Cwhere
C: AllocateIn,
Source§type Config = <C as AllocateIn>::Alloc
type Config = <C as AllocateIn>::Alloc
The associated
Vec
configuration type.