Struct VmHeap

Source
pub struct VmHeap {
    zones: [Vec<Arc<UmaZone>>; 63],
    stats: CpuLocal<RefCell<Stats>>,
}
Expand description

Kernel heap that allocate a memory from a virtual memory management system. This struct is a merge of malloc_type and malloc_type_internal structure.

Fields§

§zones: [Vec<Arc<UmaZone>>; 63]§stats: CpuLocal<RefCell<Stats>>

Implementations§

Source§

impl VmHeap

Source

const KMEM_ZSHIFT: usize = 4usize

Source

const KMEM_ZBASE: usize = 16usize

Source

const KMEM_ZMASK: usize = 15usize

Source

const KMEM_ZSIZE: usize = 256usize

Source

pub fn new() -> Self

See kmeminit on the Orbis for a reference.

§Reference offsets
VersionOffset
PS4 11.000x1A4B80
Source

pub unsafe fn alloc(&self, layout: Layout) -> *mut u8

Returns null on failure.

See malloc on the Orbis for a reference.

§Safety

layout must be nonzero.

§Reference offsets
VersionOffset
PS4 11.000x1A4220
Source

pub unsafe fn dealloc(&self, _: *mut u8, _: Layout)

§Safety

ptr must be obtained with Self::alloc() and layout must be the same one that was passed to that method.

Auto Trait Implementations§

§

impl Freeze for VmHeap

§

impl !RefUnwindSafe for VmHeap

§

impl Send for VmHeap

§

impl Sync for VmHeap

§

impl Unpin for VmHeap

§

impl !UnwindSafe for VmHeap

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.