Skip to main content

SoftGpuAllocator

Struct SoftGpuAllocator 

Source
pub struct SoftGpuAllocator { /* private fields */ }
Expand description

Process-heap SoftGPU allocator with tracked pointers.

Implementations§

Source§

impl SoftGpuAllocator

Source

pub fn new(capacity: usize) -> Self

Source

pub fn bytes_in_use(&self) -> usize

Source

pub fn capacity(&self) -> usize

Source

pub fn live_count(&self) -> usize

Source

pub fn lookup(&self, ptr: *const u8) -> Option<AllocationMeta>

Source

pub fn find_covering(&self, addr: u64) -> Option<AllocationMeta>

Find SoftGPU allocation covering addr (for ISA global memory).

Source

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).

Source

pub fn write_bytes_at( &mut self, addr: u64, data: &[u8], ) -> Result<(), AllocError>

Write bytes into a SoftGPU-tracked allocation.

Source

pub fn allocate( &mut self, space: PackedHandle, size: usize, granule: usize, alignment: usize, max_alloc: usize, ) -> Result<*mut u8, AllocError>

Source

pub fn free(&mut self, ptr: *mut u8) -> Result<AllocationMeta, AllocError>

Source

pub fn contains(&self, ptr: *const u8) -> bool

Source

pub fn clear_all(&mut self)

Trait Implementations§

Source§

impl Debug for SoftGpuAllocator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SoftGpuAllocator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.