Safe API Framework
0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
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
21
#include "
rte/utils/status/rte_status.h
"
22
#include "
rte/utils/types/rte_types.h
"
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
29
RTE_DECLARE_STORAGE
(rte_mem_pool_storage_t, 64U);
30
32
typedef
struct
rte_mem_pool_impl_s *
rte_mem_pool_handle_t
;
33
35
typedef
struct
rte_mem_pool_config_s
36
{
37
size_t
block_size
;
38
size_t
block_count
;
39
}
rte_mem_pool_config_t
;
40
55
rte_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
71
rte_status_t
rte_mem_pool_acquire
(
rte_mem_pool_handle_t
handle,
void
**out_block);
72
85
rte_status_t
rte_mem_pool_release
(
rte_mem_pool_handle_t
handle,
void
*block);
86
99
rte_status_t
rte_mem_pool_stats
(
rte_mem_pool_handle_t
handle,
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_mem_pool_release
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_mem_pool_acquire
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
rte_mem_pool_handle_t
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_mem_pool_stats
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_mem_pool_create
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
rte_status_t
Common result/status codes.
Definition
rte_status.h:27
RTE_DECLARE_STORAGE
#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
rte_status.h
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
rte_types.h
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
rte_mem_pool_config_t
Configuration for rte_mem_pool_create().
Definition
rte_memory.h:36
rte_mem_pool_config_t::block_count
size_t block_count
Definition
rte_memory.h:38
rte_mem_pool_config_t::block_size
size_t block_size
Definition
rte_memory.h:37
include
rte
oal
memory
rte_memory.h
Generated by
1.18.0