Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_memory.h
Go to the documentation of this file.
1
18#ifndef RTE_OS_MEMORY_H
19#define RTE_OS_MEMORY_H
20
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
29RTE_DECLARE_STORAGE(rte_mem_pool_storage_t, 64U);
30
32typedef struct rte_mem_pool_impl_s *rte_mem_pool_handle_t;
33
35typedef struct rte_mem_pool_config_s
36{
37 size_t block_size;
38 size_t block_count;
40
55rte_status_t rte_mem_pool_create(rte_mem_pool_storage_t *storage,
56 const rte_mem_pool_config_t *config,
57 rte_mem_pool_handle_t *out_handle);
58
72
86
100 size_t *out_free_blocks,
101 size_t *out_used_blocks);
102
103/*
104 * The OSAdapter vtable (rte_osadapter_memory_t) and
105 * rte_osadapter_memory_register() live in
106 * rte_osadapter/memory/rte_osadapter_memory.h, not here (ADR-021). This
107 * header is the consumer-facing surface only.
108 */
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif /* RTE_OS_MEMORY_H */
115 /* MEMORY */
rte_status_t rte_mem_pool_release(rte_mem_pool_handle_t handle, void *block)
Returns a previously acquired block to its pool.
Definition rte_memory.c:95
rte_status_t rte_mem_pool_acquire(rte_mem_pool_handle_t handle, void **out_block)
Acquires one fixed-size block from the pool.
Definition rte_memory.c:77
struct rte_mem_pool_impl_s * rte_mem_pool_handle_t
Opaque handle to a reserved pool, returned by rte_mem_pool_create().
Definition rte_memory.h:32
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.
Definition rte_memory.c:112
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.
Definition rte_memory.c:44
rte_status_t
Common result/status codes.
Definition rte_status.h:27
#define RTE_DECLARE_STORAGE(type_name, byte_size)
Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout...
Definition rte_types.h:69
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
Configuration for rte_mem_pool_create().
Definition rte_memory.h:36