pub trait PlatformAlloc {
// Required methods
fn alloc(size: usize) -> *mut c_void;
fn realloc(ptr: *mut c_void, size: usize) -> *mut c_void;
fn dealloc(ptr: *mut c_void);
// Provided methods
fn heap_used_bytes() -> usize { ... }
fn heap_total_bytes() -> usize { ... }
}Expand description
Heap memory allocation.
Required Methods§
Provided Methods§
Sourcefn heap_used_bytes() -> usize
fn heap_used_bytes() -> usize
Phase 230 Z5 / RFC-0034 D7 — bytes currently allocated from the
platform heap. The true unified figure where the platform owns one
kernel heap shared by the C side (alloc) and the Rust
#[global_allocator]. Default 0 = “unknown / not instrumented”.
Sourcefn heap_total_bytes() -> usize
fn heap_total_bytes() -> usize
Total managed heap size in bytes (used + free), or 0 if unknown.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.