|
|
no_export constexpr auto | zxfoundation::memory::kmalloc::detail::bucket_for (u64 size) noexcept -> u32 |
| | Return the bucket index for a requested size in O(1) time.
|
|
symalias | kfree (void *ptr) noexcept -> void |
|
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).
|
|
|
no_export std::array< slub::kmem_cache_ref_active, KMALLOC_NUM_SIZES > | zxfoundation::memory::kmalloc::detail::g_caches {} |
|
no_export bool | zxfoundation::memory::kmalloc::detail::g_initialized {false} |
| no_export constexpr const char * | zxfoundation::memory::kmalloc::detail::g_names [KMALLOC_NUM_SIZES] |
| | Names for each size-class cache (diagnostic use only).
|
| no_export constexpr u64 | zxfoundation::memory::kmalloc::detail::g_sizes [KMALLOC_NUM_SIZES] |
| | Size of each bucket (powers of two, starting at 8).
|
|
no_export constexpr u64 | zxfoundation::memory::kmalloc::detail::KMALLOC_MAX_SIZE = 32768ULL |
| | Maximum single-allocation size via kmalloc.
|
|
no_export constexpr u32 | zxfoundation::memory::kmalloc::detail::KMALLOC_NUM_SIZES = 13U |
| | Number of size-class caches.
|
General-purpose kernel memory allocator — kmalloc / kfree.
SPDX-License-Identifier: Apache-2.0