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/llarp/mem_std.cpp

25 lines
365 B
C++

7 years ago
#include <llarp/mem.h>
7 years ago
7 years ago
namespace llarp {
void *std_malloc(size_t sz, size_t align) {
(void)align;
void *ptr = malloc(sz);
if (ptr)
return ptr;
abort();
}
7 years ago
7 years ago
void std_free(void *ptr) {
if (ptr)
free(ptr);
7 years ago
}
7 years ago
} // namespace llarp
7 years ago
extern "C" {
7 years ago
void llarp_mem_std() {
llarp_g_mem.alloc = llarp::std_malloc;
llarp_g_mem.free = llarp::std_free;
}
7 years ago
}