Async signal safe memory management functions for use in metric plugins.
#include <stdlib.h>
Include dependency graph for allinea_safe_malloc.h
:
This graph shows which files directly or indirectly include this file:
1
5 #ifndef ALLINEA_SAFE_MALLOC_H
6 #define ALLINEA_SAFE_MALLOC_H
7
8 #include <stdlib.h>
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
24
37 extern void* allinea_safe_malloc(size_t size);
38
40
49 extern void allinea_safe_free(void *ptr);
50
52
67 extern void* allinea_safe_calloc(size_t nmemb, size_t size);
68
70
89 extern void* allinea_safe_realloc(void *ptr, size_t size);
90
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif
Async signal safe replacements for memory management functions.
The metric library functions must be async signal safe and therefore the standard libc memory management functions (such as malloc
, free
, new
, delete
) cannot be used.
These memory management functions can safely be used by the metric plugin libraries even if they are called from inside a signal handler:
void * allinea_safe_malloc (size_t size)
malloc
.void allinea_safe_free (void * ptr)
free
.void * allinea_safe_calloc (size_t nmemb, size_t size)
calloc
.void * allinea_safe_realloc(void * ptr, size_t size)
realloc
.See also