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.
lokinet/include/llarp/mem.h

31 lines
535 B
C

7 years ago
#ifndef LLARP_MEM_H_
#define LLARP_MEM_H_
7 years ago
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
7 years ago
struct llarp_alloc
7 years ago
{
7 years ago
void * (*alloc)(size_t sz, size_t align);
7 years ago
void (*free)(void * ptr);
};
/** global memory allocator */
7 years ago
extern struct llarp_alloc llarp_g_mem;
7 years ago
/** init llarp_g_mem with stdlib malloc */
void llarp_mem_stdlib();
/** init llarp_g_mem with jemalloc */
7 years ago
void llarp_mem_jemalloc();
7 years ago
/** init llarp_g_mem with dmalloc */
7 years ago
void llarp_mem_dmalloc();
7 years ago
#ifdef __cplusplus
}
#endif
#endif