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
487 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
{
void * (*malloc)(size_t sz);
void * (*realloc)(void * ptr, size_t sz);
void * (*calloc)(size_t n, size_t sz);
void (*free)(void * ptr);
};
/** global memory allocator */
7 years ago
extern struct llarp_alloc llarp_g_mem;
7 years ago
7 years ago
void llarp_mem_jemalloc();
void llarp_mem_std();
void llarp_mem_dmalloc();
7 years ago
#ifdef __cplusplus
}
#endif
#endif