pub struct PerCpuSlab<const PAGE_SIZE: usize = 4096> { /* private fields */ }Expand description
Default per-CPU slab wrapper used by EII integrators.
Implementations§
Source§impl<const PAGE_SIZE: usize> PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> PerCpuSlab<PAGE_SIZE>
Sourcepub fn alloc(&self, layout: Layout) -> AllocResult<SlabAllocResult>
pub fn alloc(&self, layout: Layout) -> AllocResult<SlabAllocResult>
Allocate one object.
Sourcepub fn add_slab(&self, size_class: SizeClass, base: usize, bytes: usize)
pub fn add_slab(&self, size_class: SizeClass, base: usize, bytes: usize)
Register a freshly allocated slab page.
Sourcepub fn dealloc_local(
&self,
ptr: NonNull<u8>,
layout: Layout,
) -> SlabDeallocResult
pub fn dealloc_local( &self, ptr: NonNull<u8>, layout: Layout, ) -> SlabDeallocResult
Free an object on the owner CPU path.
Sourcepub fn dealloc_remote(&self, ptr: NonNull<u8>)
pub fn dealloc_remote(&self, ptr: NonNull<u8>)
Queue an object onto this slab’s remote-free list.
Trait Implementations§
Source§impl<const PAGE_SIZE: usize> SlabTrait for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> SlabTrait for PerCpuSlab<PAGE_SIZE>
Source§fn alloc(&self, layout: Layout) -> AllocResult<SlabAllocResult>
fn alloc(&self, layout: Layout) -> AllocResult<SlabAllocResult>
Allocate one object.
Source§fn add_slab(&self, size_class: SizeClass, base: usize, bytes: usize)
fn add_slab(&self, size_class: SizeClass, base: usize, bytes: usize)
Register a freshly allocated slab page.
Source§fn dealloc_local(&self, ptr: NonNull<u8>, layout: Layout) -> SlabDeallocResult
fn dealloc_local(&self, ptr: NonNull<u8>, layout: Layout) -> SlabDeallocResult
Free an object on the owner CPU path.
Source§fn dealloc_remote(&self, ptr: NonNull<u8>)
fn dealloc_remote(&self, ptr: NonNull<u8>)
Free an object on the remote CPU path.
Auto Trait Implementations§
impl<const PAGE_SIZE: usize = 4096> !Freeze for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize = 4096> !RefUnwindSafe for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> Send for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> Sync for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> Unpin for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> UnsafeUnpin for PerCpuSlab<PAGE_SIZE>
impl<const PAGE_SIZE: usize> UnwindSafe for PerCpuSlab<PAGE_SIZE>
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