ZXFoundation™ 26h2
Loading...
Searching...
No Matches
zxfoundation.memory.kmalloc Module Reference

Functions

auto zxfoundation::memory::kmalloc::kfree (void *ptr) noexcept -> void
 Free a pointer previously returned by kmalloc().
template<typename T>
auto zxfoundation::memory::kmalloc::kfree_t (T *ptr) noexcept -> void
 Typed kfree: calls T::~T() then frees the slab slot.
symalias kmalloc (u64 size) noexcept -> void *
auto zxfoundation::memory::kmalloc::kmalloc (u64 size) noexcept -> void *
 Allocate at least size bytes of kernel memory.
auto zxfoundation::memory::kmalloc::kmalloc_bucket (u64 size) noexcept -> u32
 Return the bucket index for a size, or KMALLOC_NUM_SIZES if too large.
auto zxfoundation::memory::kmalloc::kmalloc_bucket_size (u32 idx) noexcept -> u64
 Return the size of the Nth bucket, or 0 if out of range.
auto zxfoundation::memory::kmalloc::kmalloc_cache (u32 idx) noexcept -> slub::kmem_cache_ref_active
 Return the kmem_cache for the Nth bucket, or nullptr.
auto zxfoundation::memory::kmalloc::kmalloc_init () noexcept -> void
 Create all size-class caches.
template<typename T>
auto zxfoundation::memory::kmalloc::kmalloc_t () noexcept -> T *
 Typed kmalloc: allocate sizeof(T), aligned to alignof(T).

Files

file  zxfoundation/memory/slub.zcomponent/kmalloc.cxxm
 General-purpose kernel memory allocator — kmalloc / kfree.