pub struct UmaKeg {
vm: Arc<Vm>,
size: NonZero<usize>,
pgoff: usize,
ppera: usize,
ipers: usize,
alloc: fn(&Vm, Alloc) -> *mut u8,
init: Option<fn()>,
max_pages: usize,
recurse: AtomicU32,
flags: UmaFlags,
state: Mutex<KegState>,
}Expand description
Implementation of uma_keg structure.
Fields§
§vm: Arc<Vm>§size: NonZero<usize>§pgoff: usize§ppera: usize§ipers: usize§alloc: fn(&Vm, Alloc) -> *mut u8§init: Option<fn()>§max_pages: usize§recurse: AtomicU32§flags: UmaFlags§state: Mutex<KegState>Implementations§
Source§impl UmaKeg
impl UmaKeg
Sourcepub(super) fn new(
vm: Arc<Vm>,
size: NonZero<usize>,
align: usize,
init: Option<fn()>,
flags: UmaFlags,
) -> Self
pub(super) fn new( vm: Arc<Vm>, size: NonZero<usize>, align: usize, init: Option<fn()>, flags: UmaFlags, ) -> Self
align is the actual alignment minus one, which mean if you want each item to be 8
bytes alignment this value will be 7.
See keg_ctor on the Orbis for a reference.
§Reference offsets
| Version | Offset |
|---|---|
| PS4 11.00 | 0x13CF40 |
pub fn size(&self) -> NonZero<usize>
pub fn item_per_slab(&self) -> usize
pub fn recurse(&self) -> u32
pub fn flags(&self) -> UmaFlags
Sourcepub fn fetch_slab(self: &Arc<Self>, flags: Alloc) -> Option<NonNull<Slab<()>>>
pub fn fetch_slab(self: &Arc<Self>, flags: Alloc) -> Option<NonNull<Slab<()>>>
Unlike Orbis, our slab contains a strong reference to its keg. That mean all allocated slabs need to free manually otherwise the keg will be leak.
See keg_fetch_slab on the Orbis for a reference.
§Reference offsets
| Version | Offset |
|---|---|
| PS4 11.00 | 0x141E20 |
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UmaKeg
impl !RefUnwindSafe for UmaKeg
impl Unpin for UmaKeg
impl !UnwindSafe for UmaKeg
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