Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
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
19
#include "
safeapi/oal/memory/sapi_memory.h
"
20
#include "
safeapi/utils/status/sapi_status.h
"
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
31
typedef
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);
40
sapi_status_t
(*
release
)(
sapi_mem_pool_handle_t
handle,
void
*block);
42
sapi_status_t
(*
stats
)(
sapi_mem_pool_handle_t
handle,
43
size_t
*out_free_blocks,
size_t
*out_used_blocks);
44
}
sapi_mem_pool_backend_t
;
45
53
sapi_status_t
sapi_mem_pool_register_backend
(
const
sapi_mem_pool_backend_t
*backend);
54
55
#ifdef __cplusplus
56
}
57
#endif
58
59
#endif
/* SAFEAPI_OS_MEMORY_BACKEND_H */
60
/* MEMORY_BACKEND */
sapi_mem_pool_register_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
sapi_mem_pool_handle_t
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
sapi_status_t
Common result/status codes.
Definition
sapi_status.h:27
sapi_memory.h
OS Abstraction Layer - Static memory reservation service.
sapi_status.h
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
sapi_mem_pool_backend_t
Backend vtable: an integrator's implementation of the memory pool service (ADR-005)....
Definition
sapi_memory_backend.h:32
sapi_mem_pool_backend_t::acquire
sapi_status_t(*) acquire(sapi_mem_pool_handle_t handle, void **out_block)
Backend implementation of sapi_mem_pool_acquire(). May be NULL.
Definition
sapi_memory_backend.h:38
sapi_mem_pool_backend_t::create
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.
Definition
sapi_memory_backend.h:34
sapi_mem_pool_backend_t::stats
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.
Definition
sapi_memory_backend.h:42
sapi_mem_pool_backend_t::release
sapi_status_t(*) release(sapi_mem_pool_handle_t handle, void *block)
Backend implementation of sapi_mem_pool_release(). May be NULL.
Definition
sapi_memory_backend.h:40
sapi_mem_pool_config_t
Configuration for sapi_mem_pool_create().
Definition
sapi_memory.h:36
include
safeapi_backend
memory
sapi_memory_backend.h
Generated by
1.18.0