|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Fixed-size memory pools reserved at initialization (ADR-001). More...
Files | |
| file | src/oal/memory/rte_memory.c |
| Memory pool service: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_memory_register() (ADR-005). | |
Data Structures | |
| struct | rte_mem_pool_config_t |
| Configuration for rte_mem_pool_create(). More... | |
Typedefs | |
| typedef struct rte_mem_pool_impl_s * | rte_mem_pool_handle_t |
| Opaque handle to a reserved pool, returned by rte_mem_pool_create(). | |
Functions | |
| RTE_DECLARE_STORAGE (rte_mem_pool_storage_t, 64U) | |
| Caller-owned, fixed-size storage backing one rte_mem_pool_handle_t. | |
| rte_status_t | rte_mem_pool_create (rte_mem_pool_storage_t *storage, const rte_mem_pool_config_t *config, rte_mem_pool_handle_t *out_handle) |
| Reserves a fixed-size-block memory pool. | |
| rte_status_t | rte_mem_pool_acquire (rte_mem_pool_handle_t handle, void **out_block) |
| Acquires one fixed-size block from the pool. | |
| rte_status_t | rte_mem_pool_release (rte_mem_pool_handle_t handle, void *block) |
| Returns a previously acquired block to its pool. | |
| rte_status_t | rte_mem_pool_stats (rte_mem_pool_handle_t handle, size_t *out_free_blocks, size_t *out_used_blocks) |
| Reports current free/used block counts for diagnostics. | |
Fixed-size memory pools reserved at initialization (ADR-001).
| typedef struct rte_mem_pool_impl_s* rte_mem_pool_handle_t |
Opaque handle to a reserved pool, returned by rte_mem_pool_create().
Definition at line 32 of file rte_memory.h.
| rte_status_t rte_mem_pool_create | ( | rte_mem_pool_storage_t * | storage, |
| const rte_mem_pool_config_t * | config, | ||
| rte_mem_pool_handle_t * | out_handle ) |
Reserves a fixed-size-block memory pool.
| storage | Caller-owned storage for the handle's state. Must not be NULL. |
| config | Pool configuration. Must not be NULL; config->block_size and config->block_count must both be > 0. |
| out_handle | Receives the created pool's handle. Must not be NULL. |
Definition at line 44 of file rte_memory.c.
| rte_status_t rte_mem_pool_acquire | ( | rte_mem_pool_handle_t | handle, |
| void ** | out_block ) |
Acquires one fixed-size block from the pool.
| handle | Pool handle. Must not be NULL. |
| out_block | Receives a pointer to the acquired block. Must not be NULL; set to NULL on failure. |
Definition at line 77 of file rte_memory.c.
| rte_status_t rte_mem_pool_release | ( | rte_mem_pool_handle_t | handle, |
| void * | block ) |
Returns a previously acquired block to its pool.
| handle | Pool handle. Must not be NULL. |
| block | Block previously returned by rte_mem_pool_acquire(). Must not be NULL. |
Definition at line 95 of file rte_memory.c.
| rte_status_t rte_mem_pool_stats | ( | rte_mem_pool_handle_t | handle, |
| size_t * | out_free_blocks, | ||
| size_t * | out_used_blocks ) |
Reports current free/used block counts for diagnostics.
| handle | Pool handle. Must not be NULL. |
| out_free_blocks | Receives the number of free blocks. Must not be NULL. |
| out_used_blocks | Receives the number of used blocks. Must not be NULL. |
Definition at line 112 of file rte_memory.c.