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

27 lines
374 B
C++

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