pub struct SoftGpuAllocator { /* private fields */ }Expand description
Process-heap SoftGPU allocator with tracked pointers.
Implementations§
Source§impl SoftGpuAllocator
impl SoftGpuAllocator
pub fn new(capacity: usize) -> Self
pub fn bytes_in_use(&self) -> usize
pub fn capacity(&self) -> usize
pub fn live_count(&self) -> usize
pub fn lookup(&self, ptr: *const u8) -> Option<AllocationMeta>
Sourcepub fn find_covering(&self, addr: u64) -> Option<AllocationMeta>
pub fn find_covering(&self, addr: u64) -> Option<AllocationMeta>
Find SoftGPU allocation covering addr (for ISA global memory).
Sourcepub fn read_bytes_at(&self, addr: u64, out: &mut [u8]) -> Result<(), AllocError>
pub fn read_bytes_at(&self, addr: u64, out: &mut [u8]) -> Result<(), AllocError>
Read bytes from a SoftGPU-tracked allocation (fail closed if OOB/unknown).
Sourcepub fn write_bytes_at(
&mut self,
addr: u64,
data: &[u8],
) -> Result<(), AllocError>
pub fn write_bytes_at( &mut self, addr: u64, data: &[u8], ) -> Result<(), AllocError>
Write bytes into a SoftGPU-tracked allocation.
pub fn allocate( &mut self, space: PackedHandle, size: usize, granule: usize, alignment: usize, max_alloc: usize, ) -> Result<*mut u8, AllocError>
pub fn free(&mut self, ptr: *mut u8) -> Result<AllocationMeta, AllocError>
pub fn contains(&self, ptr: *const u8) -> bool
pub fn clear_all(&mut self)
Trait Implementations§
Source§impl Debug for SoftGpuAllocator
impl Debug for SoftGpuAllocator
Auto Trait Implementations§
impl !Freeze for SoftGpuAllocator
impl !Sync for SoftGpuAllocator
impl RefUnwindSafe for SoftGpuAllocator
impl Send for SoftGpuAllocator
impl Unpin for SoftGpuAllocator
impl UnsafeUnpin for SoftGpuAllocator
impl UnwindSafe for SoftGpuAllocator
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