Skip to main content

Crate ax_alloc

Crate ax_alloc 

Source
Expand description

ArceOS global memory allocator.

It provides GlobalAllocator, which implements the trait core::alloc::GlobalAlloc. A static global variable of type GlobalAllocator is defined with the #[global_allocator] attribute, to be registered as the standard library’s default allocator.

Modules§

tracking
Tracking of memory usage, enabled with the tracking feature.

Structs§

GlobalAllocator
The global allocator used by ArceOS when buddy-slab is enabled.
GlobalPage
A RAII wrapper of contiguous 4K-sized pages.
Usages
Statistics of memory usages.

Enums§

AllocError
The error type used for allocation operations in ax-alloc.
UsageKind
Kinds of memory usage for tracking.

Traits§

AllocatorOps
Unified allocator operations provided by all ax-alloc backends.

Functions§

global_add_memory
Add the given memory region to the global allocator.
global_allocator
Returns the reference to the global allocator.
global_init
Initializes the global allocator with the given memory region.
init_percpu_slab
Initializes the per-CPU slab for the current CPU.

Type Aliases§

AllocResult
A Result alias with AllocError as the error type.
DefaultByteAllocator
The default byte allocator for buddy-slab mode.