Provides a thread-safe pool memory resource for efficient allocation and deallocation of memory blocks.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8c6c1308f3f6ProvenanceOpen questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Provides a thread-safe pool memory resource for efficient allocation and deallocation of memory blocks.
The class ara::core::SynchronizedPoolResource provides a thread-safe memory resource that handles allocations via internal pools and requests additional memory from a higher-level upstream resource ([SWS_CORE_00030]). In contrast to the C++ standard, memory allocation does not throw exceptions upon failures, but instead returns nullptr ([SWS_CORE_00061]). Copy operations are completely prevented, while move operations are explicitly supported. In addition, the destructor is non-virtual, which is why instances must not be deallocated polymorphically via a base class pointer.
Context
The class ara::core::SynchronizedPoolResource provides a thread-safe memory resource for the AUTOSAR Adaptive Platform within the module core. It is based on the concept of std::pmr::synchronized_pool_resource according to C++ standard [mem.res.pool] and derives publicly from the base class MemoryResource. Its core task is to manage memory blocks via internal pools categorized by size classes in order to handle recurring allocations efficiently and concurrently. If the internal supply is insufficient, the instance obtains larger memory blocks from a higher-level upstream memory resource ([SWS_CORE_00038]).
Typical interaction partners include concurrent threads of an application requesting allocations, the SynchronizedPoolResource as an intermediary pool manager, and an underlying MemoryResource as an upstream source. All central access and management functions such as do_allocate, do_deallocate, options, and release are designed to be thread-safe ([SWS_CORE_00061], [SWS_CORE_00041], [SWS_CORE_00039], [SWS_CORE_00037]).
Context diagram: Interplay between concurrent application threads, the pool resource, and the upstream memory source. Sources: [SWS_CORE_00030], [SWS_CORE_00038].
Lifecycle
The instantiation of SynchronizedPoolResource can occur via several constructor overloads. If both allocation options (PoolOptions) and an upstream resource are available, initialization guarantees complete exception safety and is declared as noexcept ([SWS_CORE_00030]). In addition, there are constructors without parameters ([SWS_CORE_00031]), with an upstream pointer only ([SWS_CORE_00032]), or with pool options only ([SWS_CORE_00033]). Interpretation: If no upstream pointer is passed, the implementation presumably falls back on a platform-specific default memory resource. Question Q-5dafb414672249dc (open)
Regarding ownership, the class strictly excludes copying: both the copy constructor ([SWS_CORE_00034]) and the copy assignment operator ([SWS_CORE_00036]) are deleted (=delete). In contrast to the ISO C++17 standard, however, AUTOSAR explicitly defines move semantics for this class: a move constructor ([SWS_CORE_00043]) and a move assignment operator ([SWS_CORE_00044]) are each provided as noexcept=default.
A central aspect of destruction is the deviation from standard behavior: the destructor ~SynchronizedPoolResource() is explicitly non-virtual ([SWS_CORE_00035]). Interpretation: Since the destructor is not virtual, polymorphic destruction via a pointer of base class MemoryResource* is likely to lead to undefined behavior; instances should therefore always be destroyed via their concrete type. Question Q-5add73880279b024 (open) In addition, by calling release(), all allocated memory can be returned to the upstream resource while the resource object remains intact ([SWS_CORE_00037]).
Usage Path
The typical sequence comprises initialization, repeated allocation and deallocation of memory blocks, and final cleanup:
Initialization: The application creates the instance specifying configuration parameters and a higher-level memory resource ([SWS_CORE_00030]). The active settings can be queried via options() ([SWS_CORE_00039]), and the upstream pointer via upstream_resource() ([SWS_CORE_00038]).
Memory allocation: Memory requests are processed in a protected manner via do_allocate ([SWS_CORE_00061]). Interpretation: The invocation in application code usually does not take place directly via the protected method do_allocate, but via the inherited public interface allocate of the base class MemoryResource. Question Q-1542a47cdff73dfb (open)
Identity check: Via do_is_equal, it can be determined whether two memory resources are equivalent to each other ([SWS_CORE_00042]).
Deallocation: Individual memory areas are returned to the pool via do_deallocate ([SWS_CORE_00041]). If required, all memory of all pools can be returned collectively to the upstream resource via release() ([SWS_CORE_00037]).
In error handling, the AUTOSAR Adaptive Platform deliberately deviates from the exception conventions of the C++ standard:
Allocation error: While ISO C++ provides for throwing std::bad_alloc in the event of exhaustion, do_allocate in AUTOSAR is defined as noexcept. If no suitable memory block can be provided, the method mandatorily returns a null pointer (nullptr) instead ([SWS_CORE_00061]). Callers must therefore check every allocation return value for nullptr.
Deallocation error: The method do_deallocate is also noexcept. If an error occurs when returning a memory block, it is silently ignored according to the specification ([SWS_CORE_00041]).
Construction risks: While the constructor with options and upstream resource is exception-safe ([SWS_CORE_00030]), the constructors without an upstream specification or without options are classified as not exception-safe ("not exception safe") ([SWS_CORE_00031], [SWS_CORE_00032], [SWS_CORE_00033]). Interpretation: If the internal provisioning of pool management structures fails for these constructors, object creation may fail. Question (open)
This class guide summarizes the specification of ara::core::SynchronizedPoolResource for AUTOSAR Adaptive Release R25-11.
except for the following deviations: 1. The function is noexcept 2. The function returns nullptr instead of (potentially) throwing a std::bad_alloc exception ≙ std::bad_alloc
As per corresponding usage in [mem.res.pool] except for the following deviations: 1. The function is noexcept 2. The function returns nullptr instead of (potentially) throwing a std::bad_alloc exception
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: d6b2e58cc49aProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Usage and Allocation Semantics
The member function do_allocate of class ara::core::SynchronizedPoolResource from the header file #include "ara/core/memory_resource.h" serves to allocate memory areas with the specified byte size bytes and alignment alignment[SWS_CORE_00061]. In the event of success, the synchronous call returns a valid pointer of type void* to the allocated memory block according to [mem.res.pool][SWS_CORE_00061].
Error Handling and Deviations
Regarding error behavior, the implementation explicitly deviates from the requirements in [mem.res.pool]: The method is declared as noexcept and does not throw a std::bad_alloc exception [SWS_CORE_00061]. Upon failure of the memory request, the returned pointer is instead mandatorily nullptr[SWS_CORE_00061]. Callers must therefore check the return value for a null pointer to reliably intercept allocation errors.
Concurrency and Interaction
The function is specified as exception safe and, in contrast to other memory resources, as thread-safe[SWS_CORE_00061]. Due to its protected visibility, it is expected in practice to function primarily as an internal override of the pure virtual base interface do_allocate from ara::core::MemoryResource[SWS_CORE_06566]. Question Q-95ba181693426bfc (open) While ara::core::SynchronizedPoolResource secures concurrent access [SWS_CORE_00061], comparable implementations such as ara::core::UnsynchronizedPoolResource::do_allocate[SWS_CORE_00058] and ara::core::MonotonicBufferResource::do_allocate[SWS_CORE_06569] are defined as not thread-safe.
This text was generated by an AI system based on the AUTOSAR Adaptive R25-11 specification.
As per corresponding usage in [mem.res.pool] except for the following deviations: 1. The function is noexcept 2. If unsuccessful: errors will be silently ignored
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: b07cac0de0a1ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The protected member function do_deallocate of class ara::core::SynchronizedPoolResource serves to deallocate a previously allocated memory area according to [SWS_CORE_00041]. Its call occurs synchronously and expects a pointer p to the memory area, the size bytes in bytes, and the memory alignment alignment as parameters. Since the member function is declared with visibility protected, it is presumably not called directly in regular application code, but executed via the public deallocation interface of the base class ara::core::MemoryResource ([SWS_CORE_06567]). Question Q-badea921c907c214 (open)
Regarding error handling and exception behavior, the specification defines two mandatory deviations from the standard:
The function is declared as noexcept and completely exception safe (exception safe) ([SWS_CORE_00041]).
If deallocation is not successful, occurring errors are silently ignored ([SWS_CORE_00041]). Neither throwing an exception nor reporting an error code takes place.
In the area of concurrency, the implementation in ara::core::SynchronizedPoolResource is characterized by the fact that it is explicitly specified as thread-safe (thread-safe) ([SWS_CORE_00041]). It is therefore suitable for simultaneous invocation from multiple threads. In this respect, it differs essentially from the related resources ara::core::UnsynchronizedPoolResource ([SWS_CORE_00059]) and ara::core::MonotonicBufferResource ([SWS_CORE_06570]), which are classified as not thread-safe.
This text was generated by an AI based on the AUTOSAR R25-11 specification.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c89ab0c97360ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The protected member function do_is_equal checks the equality of an instance of ara::core::SynchronizedPoolResource with another memory resource [SWS_CORE_00042]. It overrides the pure virtual base class method from ara::core::MemoryResource[SWS_CORE_06568] according to the specification for pool resources in [mem.res.pool].
Usage and interface: A reference to another ara::core::MemoryResource object is passed as a parameter (const MemoryResource &other). The return value of type bool indicates whether both resources are equivalent. Interpretation: Due to the visibility protected, the function is not called directly in the regular application flow, but is executed via the public comparison method of the base class. Question Q-29fb2980d1241fae (open)
Error handling and safety: The method is declared with the identifier noexcept and specified as exception safe[SWS_CORE_00042]. Neither exceptions nor specific error codes occur. Execution is synchronous.
Concurrency: According to [SWS_CORE_00042], do_is_equal is specified as thread-safe, so that simultaneous comparisons across multiple threads are permitted without additional external synchronization.
Interplay: The function forms the thread-safe counterpart to the implementation in ara::core::UnsynchronizedPoolResource[SWS_CORE_00060]. Likewise, ara::core::MonotonicBufferResource provides a corresponding override, which is also designated as noexcept[SWS_CORE_06571].
This text was generated by an AI based on the AUTOSAR Adaptive R25-11 specification.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 4714ac548826ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The member function options of class ara::core::SynchronizedPoolResource synchronously returns the settings configured for the memory resource of type PoolOptions[SWS_CORE_00039]. The call takes no parameters on an instance of the class and is declared via the header ara/core/memory_resource.h[SWS_CORE_00039]. According to the specification, the behavior is modeled on [mem.res.pool][SWS_CORE_00039], which may be interpreted as leaning on the pool resources of the C++ standard. Question Q-9abfddc2cf8dc88c (open)
Regarding error handling and exception safety, the method is declared as noexcept and is considered completely exception-safe (exception safe) [SWS_CORE_00039]. Specific error codes or notifications to DET or DEM do not exist for this query function.
Regarding concurrency, the method is specified as const as well as explicitly thread-safe (thread-safe) [SWS_CORE_00039]. It can thus be safely called in parallel from multiple threads without additional synchronization measures at user level.
In interaction within ara::core, [SWS_CORE_00057] provides the unsynchronized counterpart: For ara::core::UnsynchronizedPoolResource, there exists a function options with the same name and signature and with identical semantics according to [mem.res.pool].
This text was generated by an AI and serves as an orienting usage aid.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 32c426df4959ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The synchronous member function release() belongs to class ara::core::SynchronizedPoolResource and is provided via the header file #include "ara/core/memory_resource.h"[SWS_CORE_00037]. It has the signature void release () noexcept;, takes no parameters, and has no return value. The functional semantics follow the corresponding usage in [mem.res.pool][SWS_CORE_00037], thereby releasing the memory managed by the memory resource.
Regarding error handling, the function is declared as exception safe (exception safe) and noexcept[SWS_CORE_00037]. No C++ exceptions occur; specific error codes or error reports via DET or DEM are not defined within the scope of the specification.
Regarding concurrency, the operation is explicitly specified as thread-safe (thread-safe) [SWS_CORE_00037]. A simultaneous invocation from multiple threads on the same resource instance is therefore expected to be permissible without additional application-side locks. Question Q-3da3b45ca2070b3e (open)
In interaction, the behavior corresponds to the functionally equivalent method in ara::core::UnsynchronizedPoolResource[SWS_CORE_00065], which likewise refers to [mem.res.pool] and is designated as noexcept as well as thread-safe. In contrast, the analogous release() function of ara::core::MonotonicBufferResource[SWS_CORE_06530] is not thread-safe (not thread-safe) according to the specification, although it is likewise subject to the noexcept guarantee.
This text was created by an AI and is based solely on specification data from AUTOSAR R25-11.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6f69b7b33ad7Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The member function upstream_resource() of class ara::core::SynchronizedPoolResource returns a pointer to the underlying upstream memory resource (MemoryResource*) according to [SWS_CORE_00038]. The invocation is synchronous and requires including the header file #include "ara/core/memory_resource.h"[SWS_CORE_00038]. The function takes no arguments and serves as a pure inspector for the upstream memory management unit.
Error Handling and Exception Safety
The method is declared as noexcept and classified as exception safe (exception safe) according to the specification [SWS_CORE_00038]. Failure of the query or throwing exceptions is excluded; error codes do not exist for this call.
Concurrency and Limitations
The function is specified as const as well as explicitly as thread-safe (thread-safe) [SWS_CORE_00038]. It can thus be invoked concurrently from multiple execution contexts without additional external synchronization.
Interaction
The concept of an upstream memory resource is consistently provided across various memory pool implementations of AUTOSAR Adaptive Core:
In ara::core::UnsynchronizedPoolResource, the functionally identical method [SWS_CORE_00056] likewise provides a pointer to the upstream resource, but is targeted at pool scenarios that are not internally synchronized.
In ara::core::MonotonicBufferResource, a corresponding counterpart exists with [SWS_CORE_06531], which is likewise specified as noexcept as well as thread-safe.
This usage note was automatically generated based on the AUTOSAR payload.
gemini-3.8-flash-low· 2026-10-13 · German original