Zephyr Project Requirements
Memory Objects

Memory Objects

STATEMENT:

SPDX-License-Identifier: Apache-2.0

ZEP-SRS-9-1
1. Dynamic Memory Allocation
UID: ZEP-SRS-9-1
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall allow threads to dynamically allocate variable-sized memory regions from a specified range of memory.

USER_STORY:

As a Zephyr RTOS user I want my application to be able to dynamically allocate memory of a application defined size.

ZEP-SRS-9-2
2. Memory Slab Object
UID: ZEP-SRS-9-2
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall allow threads to dynamically allocate fixed-sized memory regions from a specified range of memory.

USER_STORY:

As a Zephyr RTOS user I want a most efficient and least fragmentation prone dynamic memory allocation mechanism.

ZEP-SRS-9-3
3. Heap definition at compile time
UID: ZEP-SRS-9-3
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to define and initialize a memory heap at compile time.

ZEP-SRS-9-4
4. Heap initialization at run time
UID: ZEP-SRS-9-4
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to initialize a memory heap at run time over a caller-provided memory region.

ZEP-SRS-9-5
5. Heap allocation
UID: ZEP-SRS-9-5
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to allocate a block of memory of a requested size from a heap.

ZEP-SRS-9-6
6. Heap aligned allocation
UID: ZEP-SRS-9-6
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to allocate a block of memory from a heap with a requested alignment.

ZEP-SRS-9-7
7. Heap allocation timeout
UID: ZEP-SRS-9-7
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

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.

ZEP-SRS-9-8
8. Heap allocation failure
UID: ZEP-SRS-9-8
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

When sufficient memory cannot be allocated from a heap within the specified time, the Zephyr RTOS shall report that the allocation failed.

ZEP-SRS-9-9
9. Heap reallocation
UID: ZEP-SRS-9-9
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

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.

ZEP-SRS-9-10
10. Heap free
UID: ZEP-SRS-9-10
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to release a previously allocated block of memory back to its heap.

ZEP-SRS-9-11
11. System heap allocation and release
UID: ZEP-SRS-9-11
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to allocate memory from and release memory to a shared system heap.

ZEP-SRS-9-12
12. Memory slab definition at compile time
UID: ZEP-SRS-9-12
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to define and initialize a memory slab of fixed-size blocks at compile time.

ZEP-SRS-9-13
13. Memory slab initialization at run time
UID: ZEP-SRS-9-13
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to initialize a memory slab at run time over a caller-provided memory region.

ZEP-SRS-9-14
14. Memory slab block allocation
UID: ZEP-SRS-9-14
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

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.

ZEP-SRS-9-15
15. Memory slab allocation timeout expiry
UID: ZEP-SRS-9-15
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

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.

ZEP-SRS-9-16
16. Memory slab block free
UID: ZEP-SRS-9-16
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to release a previously allocated block back to its memory slab.

ZEP-SRS-9-17
17. Memory slab usage statistics
UID: ZEP-SRS-9-17
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to query the number of used and free blocks in a memory slab.

ZEP-SRS-9-18
18. Enumerating defined heaps
UID: ZEP-SRS-9-18
STATUS: Draft
TYPE: Functional
COMPONENT: Memory Objects
RELATIONS (Parent):
STATEMENT:

The Zephyr RTOS shall provide a mechanism to obtain the set of heaps that were defined at compile time.