#[repr(transparent)]pub struct ProcessHeap;Expand description
HeapAlloc / HeapReAlloc / HeapFree / HeapSize on GetProcessHeap()
| Rust | C |
|---|---|
thin::Alloc::alloc_uninit | HeapAlloc(GetProcessHeap(), 0, size) |
thin::Alloc::alloc_zeroed | HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size) |
thin::Realloc::realloc_uninit | HeapReAlloc(GetProcessHeap(), 0, ptr, size) |
thin::Realloc::realloc_zeroed | HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ptr, size) |
thin::Free::free | HeapFree(GetProcessHeap(), 0, ptr) |
thin::SizeOf::size_of | HeapSize(GetProcessHeap(), 0, ptr) |
§Recommended Reading
Trait Implementations§
Source§impl Alloc for ProcessHeap
impl Alloc for ProcessHeap
Source§impl Alloc for ProcessHeap
impl Alloc for ProcessHeap
Source§fn alloc_uninit(
&self,
layout: Layout,
) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
fn alloc_uninit( &self, layout: Layout, ) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
Source§impl Clone for ProcessHeap
impl Clone for ProcessHeap
impl Copy for ProcessHeap
Source§impl Debug for ProcessHeap
impl Debug for ProcessHeap
Source§impl Default for ProcessHeap
impl Default for ProcessHeap
impl Eq for ProcessHeap
Source§impl Free for ProcessHeap
impl Free for ProcessHeap
Source§unsafe fn free_nullable(&self, ptr: *mut MaybeUninit<u8>)
unsafe fn free_nullable(&self, ptr: *mut MaybeUninit<u8>)
Source§impl Free for ProcessHeap
impl Free for ProcessHeap
Source§impl From<ProcessHeap> for &'static Heap
impl From<ProcessHeap> for &'static Heap
Source§fn from(_: ProcessHeap) -> Self
fn from(_: ProcessHeap) -> Self
Converts to this type from the input type.
Source§impl Hash for ProcessHeap
impl Hash for ProcessHeap
Source§impl Meta for ProcessHeap
impl Meta for ProcessHeap
Source§const MAX_ALIGN: Alignment = super::MEMORY_ALLOCATION_ALIGNMENT
const MAX_ALIGN: Alignment = super::MEMORY_ALLOCATION_ALIGNMENT
The alignment of memory returned by HeapAlloc is MEMORY_ALLOCATION_ALIGNMENT in WinNT.h:
#if defined(_WIN64) || defined(_M_ALPHA)
#define MEMORY_ALLOCATION_ALIGNMENT 16
#else
#define MEMORY_ALLOCATION_ALIGNMENT 8
#endifhttps://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapalloc#remarks
Source§const MAX_SIZE: usize = usize::MAX
const MAX_SIZE: usize = usize::MAX
Indicates the maximum size this allocator should be expected to succeed in allocating.
Requesting an allocation larger than this is almost certainly a bug. Read more
Source§const ZST_SUPPORTED: bool = true
const ZST_SUPPORTED: bool = true
Indicates if this allocator supports zero-sized allocations.
While this is nice and Rust-friendly, it may not be supported by C or C++ allocators.
Source§impl Ord for ProcessHeap
impl Ord for ProcessHeap
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ProcessHeap
impl PartialEq for ProcessHeap
Source§impl PartialOrd for ProcessHeap
impl PartialOrd for ProcessHeap
Source§impl Realloc for ProcessHeap
impl Realloc for ProcessHeap
Source§const CAN_REALLOC_ZEROED: bool = Heap::CAN_REALLOC_ZEROED
const CAN_REALLOC_ZEROED: bool = Heap::CAN_REALLOC_ZEROED
Indicate if
realloc_zeroed is supported / likely to work.Source§unsafe fn realloc_uninit(
&self,
ptr: NonNull<MaybeUninit<u8>>,
new_size: usize,
) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
unsafe fn realloc_uninit( &self, ptr: NonNull<MaybeUninit<u8>>, new_size: usize, ) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
Source§unsafe fn realloc_zeroed(
&self,
ptr: NonNull<MaybeUninit<u8>>,
new_size: usize,
) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
unsafe fn realloc_zeroed( &self, ptr: NonNull<MaybeUninit<u8>>, new_size: usize, ) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
Source§impl Realloc for ProcessHeap
impl Realloc for ProcessHeap
Source§unsafe fn realloc_uninit(
&self,
ptr: NonNull<MaybeUninit<u8>>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
unsafe fn realloc_uninit( &self, ptr: NonNull<MaybeUninit<u8>>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
Source§unsafe fn realloc_zeroed(
&self,
ptr: NonNull<MaybeUninit<u8>>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
unsafe fn realloc_zeroed( &self, ptr: NonNull<MaybeUninit<u8>>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<MaybeUninit<u8>>, Self::Error>
Source§impl SizeOf for ProcessHeap
impl SizeOf for ProcessHeap
Source§impl SizeOfDebug for ProcessHeap
impl SizeOfDebug for ProcessHeap
Source§unsafe fn size_of_debug(&self, ptr: NonNull<MaybeUninit<u8>>) -> Option<usize>
unsafe fn size_of_debug(&self, ptr: NonNull<MaybeUninit<u8>>) -> Option<usize>
impl Stateless for ProcessHeap
impl StructuralPartialEq for ProcessHeap
impl ZstSupported for ProcessHeap
Auto Trait Implementations§
impl Freeze for ProcessHeap
impl RefUnwindSafe for ProcessHeap
impl Send for ProcessHeap
impl Sync for ProcessHeap
impl Unpin for ProcessHeap
impl UnsafeUnpin for ProcessHeap
impl UnwindSafe for ProcessHeap
Blanket Implementations§
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