lexLeo
Loading...
Searching...
No Matches
osal_mem.h
1// src/osal/include/osal_mem.h
2
3#ifndef LEXLEO_OSAL_MEM_H
4#define LEXLEO_OSAL_MEM_H
5
6#include <stddef.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12// ----------------------------------------------------------------------------
13// PUBLIC API
14// ----------------------------------------------------------------------------
15
16void *osal_malloc(size_t size);
17void osal_free(void *ptr);
18void *osal_calloc(size_t nmemb, size_t size);
19void *osal_realloc(void *ptr, size_t size);
20
21char *osal_strdup(const char *s);
22
23#ifdef __cplusplus
24}
25#endif
26
27#endif //LEXLEO_OSAL_MEM_H
28
29// <here> a handle per module
30/*
31typedef struct <module>_ctx_t {
32 <module>_deps_t deps;
33 const <module>_backends_t *backends;
34 const <module>_ops_t ops;
35 <module>_callbacks_t callbacks;
36 void *user_data;
37} <module>_ctx_t;
38typedef struct <module>_ctx_t {
39 <module>_ctx_t ctx;
40 <dep1>_t *dep1;
41} <module>_t;
42*/
43// with singleton pattern?
44// do lexleo_bootstrap module to manage all initialisation
45