mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
502 B
C
29 lines
502 B
C
#ifndef LLARP_MEM_H_
|
|
#define LLARP_MEM_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdlib.h>
|
|
|
|
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();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|