Struct psp::vram_alloc::SimpleVramAllocator
source · pub struct SimpleVramAllocator { /* private fields */ }
Implementations§
source§impl SimpleVramAllocator
impl SimpleVramAllocator
sourcepub fn free_all(&mut self)
pub fn free_all(&mut self)
Frees all previously allocated VRAM chunks.
This resets the allocator’s counter, but does not change the contents of
VRAM. Since this method requires &mut Self
, it cannot overlap with any
previously allocated VramMemChunk
s since they have the lifetime of the
&Self
that allocated them.
sourcepub fn alloc(&self, size: u32) -> VramMemChunk<'_>
pub fn alloc(&self, size: u32) -> VramMemChunk<'_>
Allocates size
bytes of VRAM
The returned VRAM chunk has the same lifetime as the
SimpleVramAllocator
borrow (i.e. &self
) that allocated it.
pub fn alloc_sized<T: Sized>(&self, count: u32) -> VramMemChunk<'_>
pub fn alloc_texture_pixels( &self, width: u32, height: u32, psm: TexturePixelFormat ) -> VramMemChunk<'_>
pub unsafe fn move_to_vram<T: Sized>(&mut self, obj: T) -> &mut T
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SimpleVramAllocator
impl RefUnwindSafe for SimpleVramAllocator
impl Send for SimpleVramAllocator
impl Sync for SimpleVramAllocator
impl Unpin for SimpleVramAllocator
impl UnwindSafe for SimpleVramAllocator
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