Memory Objects
SPDX-License-Identifier: Apache-2.0
The Zephyr RTOS shall allow threads to dynamically allocate variable-sized memory regions from a specified range of memory.
As a Zephyr RTOS user I want my application to be able to dynamically allocate memory of a application defined size.
The Zephyr RTOS shall allow threads to dynamically allocate fixed-sized memory regions from a specified range of memory.
As a Zephyr RTOS user I want a most efficient and least fragmentation prone dynamic memory allocation mechanism.
The Zephyr RTOS shall provide a mechanism to define and initialize a memory heap at compile time.
The Zephyr RTOS shall provide a mechanism to initialize a memory heap at run time over a caller-provided memory region.
The Zephyr RTOS shall provide a mechanism to allocate a block of memory of a requested size from a heap.
The Zephyr RTOS shall provide a mechanism to allocate a block of memory from a heap with a requested alignment.
When allocating memory from a heap, the Zephyr RTOS shall accept a timeout that specifies the maximum time to wait for sufficient memory to become available.
When sufficient memory cannot be allocated from a heap within the specified time, the Zephyr RTOS shall report that the allocation failed.
The Zephyr RTOS shall provide a mechanism to resize a previously allocated heap block while preserving its contents up to the smaller of the old and new sizes.
The Zephyr RTOS shall provide a mechanism to release a previously allocated block of memory back to its heap.
The Zephyr RTOS shall provide a mechanism to allocate memory from and release memory to a shared system heap.
The Zephyr RTOS shall provide a mechanism to define and initialize a memory slab of fixed-size blocks at compile time.
The Zephyr RTOS shall provide a mechanism to initialize a memory slab at run time over a caller-provided memory region.
The Zephyr RTOS shall provide a mechanism to allocate a fixed-size block from a memory slab, accepting a timeout that specifies the maximum time to wait for a free block.
When no block becomes available in a memory slab within the specified time, the Zephyr RTOS shall return an error indicating that no block was allocated.
The Zephyr RTOS shall provide a mechanism to release a previously allocated block back to its memory slab.
The Zephyr RTOS shall provide a mechanism to query the number of used and free blocks in a memory slab.
The Zephyr RTOS shall provide a mechanism to obtain the set of heaps that were defined at compile time.