2018-01-25 16:24:33 +00:00
|
|
|
#ifndef LLARP_MEM_H_
|
|
|
|
#define LLARP_MEM_H_
|
2017-10-03 19:14:46 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2018-01-29 14:27:24 +00:00
|
|
|
struct llarp_alloc {
|
|
|
|
void *(*alloc)(size_t sz, size_t align);
|
|
|
|
void (*free)(void *ptr);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** global memory allocator */
|
|
|
|
extern struct llarp_alloc llarp_g_mem;
|
|
|
|
/** init llarp_g_mem with stdlib malloc */
|
|
|
|
void llarp_mem_stdlib();
|
|
|
|
/** init llarp_g_mem with jemalloc */
|
|
|
|
void llarp_mem_jemalloc();
|
|
|
|
/** init llarp_g_mem with dmalloc */
|
|
|
|
void llarp_mem_dmalloc();
|
2017-10-03 19:14:46 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|