Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_memory_backend.h
Go to the documentation of this file.
1
16#ifndef SAFEAPI_OS_MEMORY_BACKEND_H
17#define SAFEAPI_OS_MEMORY_BACKEND_H
18
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
31typedef struct sapi_mem_pool_backend_s
32{
34 sapi_status_t (*create)(sapi_mem_pool_storage_t *storage,
35 const sapi_mem_pool_config_t *config,
36 sapi_mem_pool_handle_t *out_handle);
38 sapi_status_t (*acquire)(sapi_mem_pool_handle_t handle, void **out_block);
43 size_t *out_free_blocks, size_t *out_used_blocks);
45
54
55#ifdef __cplusplus
56}
57#endif
58
59#endif /* SAFEAPI_OS_MEMORY_BACKEND_H */
60 /* MEMORY_BACKEND */
sapi_status_t sapi_mem_pool_register_backend(const sapi_mem_pool_backend_t *backend)
Registers the backend implementation used by every sapi_mem_pool_* call (ADR-005 section 2....
Definition sapi_memory.c:25
struct sapi_mem_pool_impl_s * sapi_mem_pool_handle_t
Opaque handle to a reserved pool, returned by sapi_mem_pool_create().
Definition sapi_memory.h:32
sapi_status_t
Common result/status codes.
Definition sapi_status.h:27
OS Abstraction Layer - Static memory reservation service.
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Backend vtable: an integrator's implementation of the memory pool service (ADR-005)....
sapi_status_t(*) acquire(sapi_mem_pool_handle_t handle, void **out_block)
Backend implementation of sapi_mem_pool_acquire(). May be NULL.
sapi_status_t(*) create(sapi_mem_pool_storage_t *storage, const sapi_mem_pool_config_t *config, sapi_mem_pool_handle_t *out_handle)
Backend implementation of sapi_mem_pool_create(). May be NULL.
sapi_status_t(*) stats(sapi_mem_pool_handle_t handle, size_t *out_free_blocks, size_t *out_used_blocks)
Backend implementation of sapi_mem_pool_stats(). May be NULL.
sapi_status_t(*) release(sapi_mem_pool_handle_t handle, void *block)
Backend implementation of sapi_mem_pool_release(). May be NULL.
Configuration for sapi_mem_pool_create().
Definition sapi_memory.h:36