|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Weak backend hooks of the allocator: the part that the application (or one of the stk_memory_allocator_*.h headers) implements. More...
#include <stk_memory_allocator.h>
Static Public Member Functions | |
| static void * | Allocate (size_t size) __stk_weak |
| Allocate the memory chunk (backend hook). | |
| static void | Free (void *ptr) __stk_weak |
| Free the memory chunk (backend hook). | |
| static Stats | GetStats () __stk_weak |
| Get stats of memory allocation (backend hook, optional). | |
Weak backend hooks of the allocator: the part that the application (or one of the stk_memory_allocator_*.h headers) implements.
STK never defines these functions. If no definition is linked in, on most toolchains the symbols resolve to address 0 and a call is a jump to null (a run-time fault), not a linker error.
Definition at line 306 of file stk_memory_allocator.h.
|
static |
Allocate the memory chunk (backend hook).
| [in] | size | Size of the memory chunk. |
Definition at line 76 of file stk_memory_allocator_default.h.
References stk::memory::detail::DefaultHeapPool(), and stk::memory::BytePool::TryAlloc().
Referenced by stk::memory::MemoryAllocator::Allocate(), and stk::memory::MemoryAllocator::IsAvailable().
|
static |
Free the memory chunk (backend hook).
| [in] | ptr | Pointer to the memory chunk. nullptr is allowed and results in noop. |
Definition at line 81 of file stk_memory_allocator_default.h.
References stk::memory::detail::DefaultHeapPool(), stk::memory::BytePool::Free(), and STK_UNUSED.
Referenced by stk::memory::MemoryAllocator::Free(), and stk::memory::MemoryAllocator::IsAvailable().
|
static |
Get stats of memory allocation (backend hook, optional).
Definition at line 90 of file stk_memory_allocator_default.h.
References stk::memory::detail::DefaultHeapPool(), and stk::memory::BytePool::GetStats().
Referenced by stk::memory::MemoryAllocator::GetStats().