pub(crate) trait SubAllocator:
SubAllocatorBase
+ Debug
+ Sync
+ Send {
// Required methods
fn allocate(
&mut self,
size: u64,
alignment: u64,
allocation_type: AllocationType,
granularity: u64,
name: &str,
) -> Result<(u64, NonZeroU64)>;
fn free(&mut self, chunk_id: Option<NonZeroU64>) -> Result<()>;
fn rename_allocation(
&mut self,
chunk_id: Option<NonZeroU64>,
name: &str,
) -> Result<()>;
fn report_memory_leaks(
&self,
log_level: Level,
memory_type_index: usize,
memory_block_index: usize,
);
fn report_allocations(&self) -> Vec<AllocationReport>;
fn supports_general_allocations(&self) -> bool;
fn allocated(&self) -> u64;
// Provided method
fn is_empty(&self) -> bool { ... }
}Required Methods§
fn allocate( &mut self, size: u64, alignment: u64, allocation_type: AllocationType, granularity: u64, name: &str, ) -> Result<(u64, NonZeroU64)>
fn free(&mut self, chunk_id: Option<NonZeroU64>) -> Result<()>
fn rename_allocation( &mut self, chunk_id: Option<NonZeroU64>, name: &str, ) -> Result<()>
fn report_memory_leaks( &self, log_level: Level, memory_type_index: usize, memory_block_index: usize, )
fn report_allocations(&self) -> Vec<AllocationReport>
Sourcefn supports_general_allocations(&self) -> bool
fn supports_general_allocations(&self) -> bool
fn allocated(&self) -> u64
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".