Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2a04600
feat(platform): add no-heap static allocation PAL backend for lockste…
vtz Jun 11, 2026
a33acfd
refactor(platform): remove #ifdef SOMEIP_STATIC_ALLOC from message.h/cpp
vtz Jun 12, 2026
71c63b0
fix(platform): address merge-readiness review findings
vtz Jun 12, 2026
95e99cd
fix(platform): resolve clang-tidy warnings from intrusive ptr changes
vtz Jun 12, 2026
34ffd73
fix(platform): add message_ptr_impl.h to all PAL backend directories
vtz Jun 12, 2026
2a32a98
feat(platform): add follow-up safety hardening for static-alloc backend
vtz Jun 12, 2026
e354267
feat(platform): add container conformance tests and fix doc traceability
vtz Jun 12, 2026
69bbeda
docs: align FMEA and architecture with implementation
vtz Jun 13, 2026
ce164e3
fix(platform): add CI coverage, fix traceability, guard double-release
vtz Jun 13, 2026
1dc6696
fix(platform): mark malloc_trap operator new as noexcept
vtz Jun 13, 2026
4539753
fix(platform): make malloc_trap armable for test compatibility
vtz Jun 13, 2026
9794ef0
fix(platform): add missing <new> include for std::bad_alloc
vtz Jun 13, 2026
75f24dc
feat(platform): migrate core protocol types to PAL abstractions
vtz Jun 19, 2026
1d4bf1c
fix: resolve CI failures across static-alloc, clang-tidy, and Zephyr
vtz Jun 19, 2026
4dd19e6
fix: use pointer+size deserialize overload in UDP transport
vtz Jun 19, 2026
f9e07fe
fix: resolve remaining clang-tidy and static-alloc build issues
vtz Jun 19, 2026
64bb20c
fix: add erase() and iterator-pair ctor to static ByteBuffer
vtz Jun 19, 2026
db0c4a6
fix: cast char iterators to uint8_t for ByteBuffer insert
vtz Jun 19, 2026
1ceeb51
fix: cast uint8_t* to char* for config string deserialization
vtz Jun 19, 2026
c32ab56
fix: resolve ETL string compatibility in SD subsystem
vtz Jun 19, 2026
3994a98
fix: migrate event_subscriber maps and string concat for ETL
vtz Jun 19, 2026
e0a6947
fix: suppress redundant-string-cstr for ETL dual-backend compat
vtz Jun 19, 2026
2e3d7f0
fix: migrate test_serialization.cpp to platform types
vtz Jun 19, 2026
7dc9b15
fix: use c_str()-only ctor for String in serialize_array
vtz Jun 19, 2026
3820c2c
fix: migrate all test files to platform:: types for ETL compat
vtz Jun 19, 2026
842b6a6
ci: disable examples in static-alloc CI job
vtz Jun 19, 2026
2f6a67e
fix: static-alloc test failures — capacity and pool exhaustion
vtz Jun 19, 2026
0cfbe26
fix: prevent segfault on pool exhaustion in UDP receive loop
vtz Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ option(ENABLE_WERROR "Treat compiler warnings as errors (recommended for CI)" OF
option(SOMEIP_USE_FREERTOS "Use FreeRTOS for threading primitives" OFF)
option(SOMEIP_USE_THREADX "Use ThreadX for threading primitives" OFF)
option(SOMEIP_USE_LWIP "Use lwIP for network sockets" OFF)
option(SOMEIP_USE_STATIC_ALLOC "Use static allocation (no heap)" OFF)

# RTOS linux/POSIX port runtime tests (Linux only)
option(SOMEIP_FREERTOS_LINUX_TESTS "Build and run FreeRTOS runtime tests using FreeRTOS POSIX port" OFF)
Expand Down Expand Up @@ -196,6 +197,19 @@ if(SOMEIP_USE_LWIP)
)
endif()

# --- ETL (Embedded Template Library) for static-allocation containers ---
if(SOMEIP_USE_STATIC_ALLOC)
set(BUILD_TESTS_SAVED ${BUILD_TESTS})
set(BUILD_TESTS OFF)
FetchContent_Declare(etl
GIT_REPOSITORY https://github.com/ETLCPP/etl.git
GIT_TAG 20.47.1
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(etl)
set(BUILD_TESTS ${BUILD_TESTS_SAVED})
endif()

# Set policy for FetchContent timestamp handling (CMake 3.24+)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
Expand Down Expand Up @@ -251,6 +265,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Include directories
include_directories(include)

# Allocation backend (selects containers_impl.h, buffer_pool_impl.h, memory_impl.h)
# SOMEIP_STATIC_ALLOC is set via target_compile_definitions on opensomeip (PUBLIC),
# so it propagates to dependents but NOT to PAL mock tests that compile sources directly.
if(SOMEIP_USE_STATIC_ALLOC)
include_directories(include/platform/static)
else()
include_directories(include/platform/dynamic)
endif()

# Platform backend include directories (selects which *_impl.h files are found)
if(SOMEIP_USE_FREERTOS)
include_directories(include/platform/freertos)
Expand Down Expand Up @@ -611,6 +634,11 @@ elseif(WIN32)
else()
message(STATUS " Networking ............ BSD sockets")
endif()
if(SOMEIP_USE_STATIC_ALLOC)
message(STATUS " Allocation ............ Static (ETL, no heap)")
else()
message(STATUS " Allocation ............ Dynamic (STL)")
endif()
message(STATUS " Build tests ............. ${BUILD_TESTS}")
message(STATUS " Build examples .......... ${BUILD_EXAMPLES}")
message(STATUS " Dev tools ............... ${SOMEIP_DEV_TOOLS}")
Expand Down
21 changes: 21 additions & 0 deletions docs/requirements/implementation/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,27 @@ Testing Infrastructure

**Code Location**: ``tests/``

Static Allocation
-----------------

.. requirement:: Static Allocation Policy
:id: REQ_ARCH_008
:satisfies: REQ_ARCH_003
:status: implemented
:priority: high
:category: happy_path
:verification: Build with ``SOMEIP_USE_STATIC_ALLOC=ON`` and run unit tests with heap-interception enabled (``REQ_PAL_NOOP_HEAP_VERIFY``). Verify no ``malloc``/``new`` calls occur during protocol operation. Inspect container and pool types for compile-time capacity bounds.

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
When ``SOMEIP_USE_STATIC_ALLOC`` is enabled, the stack shall not perform
dynamic memory allocation (heap) at runtime. All buffers, containers, and
object pools shall use compile-time-sized static storage.

**Rationale**: Freedom from interference per ISO 26262 Part 6 clause 7.4.6;
WCET determinism per clause 7.4.11.

**Code Location**: ``CMakeLists.txt``, ``include/platform/static/``,
``src/platform/static/``

Traceability
============

Expand Down
Loading
Loading