#[repr(C)]pub struct MemoryManager {Show 24 fields
pub initialized: bool,
pub numHeaps: u16,
pub numPhysicalHeaps: u16,
pub heaps: *mut *mut IMemoryHeap,
pub allowOtherContextAllocs: *mut bool,
pub heapsByContext: [*mut IMemoryHeap; 127],
pub threadScrapHeap: *mut ThreadScrapHeap,
pub physicalHeaps: *mut *mut IMemoryHeap,
pub bigAllocHeap: *mut IMemoryHeap,
pub emergencyHeap: *mut IMemoryHeap,
pub smallBlockAllocator: *mut BSSmallBlockAllocator,
pub compactingStore: *mut Store,
pub externalHavokAllocator: *mut IMemoryHeap,
pub specialHeaps: bool,
pub allowPoolUse: bool,
pub pad44A: [u8; 2],
pub sysAllocBytes: u32,
pub mallocBytes: u32,
pub alignmentForPools: u32,
pub mainThreadMemoryProblemPassSignal: u32,
pub failedAllocationSize: usize,
pub numMemoryProblemPassesRun: u32,
pub timeOfLastMemoryProblemPass: usize,
pub defaultHeap: *mut IMemoryHeap,
}
Expand description
Memory manager interface
Fields§
§initialized: bool
§numHeaps: u16
§numPhysicalHeaps: u16
§heaps: *mut *mut IMemoryHeap
§allowOtherContextAllocs: *mut bool
§heapsByContext: [*mut IMemoryHeap; 127]
§threadScrapHeap: *mut ThreadScrapHeap
§physicalHeaps: *mut *mut IMemoryHeap
§bigAllocHeap: *mut IMemoryHeap
§emergencyHeap: *mut IMemoryHeap
§smallBlockAllocator: *mut BSSmallBlockAllocator
§compactingStore: *mut Store
§externalHavokAllocator: *mut IMemoryHeap
§specialHeaps: bool
§allowPoolUse: bool
§pad44A: [u8; 2]
§sysAllocBytes: u32
§mallocBytes: u32
§alignmentForPools: u32
§mainThreadMemoryProblemPassSignal: u32
§failedAllocationSize: usize
§numMemoryProblemPassesRun: u32
§timeOfLastMemoryProblemPass: usize
§defaultHeap: *mut IMemoryHeap
Implementations§
Source§impl MemoryManager
impl MemoryManager
pub const fn new() -> Self
pub unsafe fn GetSingleton() -> *mut MemoryManager
Sourcepub unsafe fn Allocate(
&mut self,
size: usize,
alignment: i32,
alignment_required: bool,
) -> *mut c_void
pub unsafe fn Allocate( &mut self, size: usize, alignment: i32, alignment_required: bool, ) -> *mut c_void
Allocate memory.
Sourcepub unsafe fn Deallocate(&mut self, mem: *mut c_void, alignment_required: bool)
pub unsafe fn Deallocate(&mut self, mem: *mut c_void, alignment_required: bool)
Deallocate memory.
Sourcepub unsafe fn GetThreadScrapHeap(&mut self) -> *mut ScrapHeap
pub unsafe fn GetThreadScrapHeap(&mut self) -> *mut ScrapHeap
Get thread-local scrap heap.
Sourcepub unsafe fn Reallocate(
&mut self,
old_mem: *mut c_void,
new_size: usize,
alignment: i32,
aligned: bool,
) -> *mut c_void
pub unsafe fn Reallocate( &mut self, old_mem: *mut c_void, new_size: usize, alignment: i32, aligned: bool, ) -> *mut c_void
Reallocate memory.
Sourcepub unsafe fn RegisterMemoryManager(&mut self)
pub unsafe fn RegisterMemoryManager(&mut self)
Register the memory manager.
Trait Implementations§
Source§impl Debug for MemoryManager
impl Debug for MemoryManager
Auto Trait Implementations§
impl Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl !Send for MemoryManager
impl !Sync for MemoryManager
impl Unpin for MemoryManager
impl UnwindSafe for MemoryManager
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