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.
25 lines
365 B
C++
25 lines
365 B
C++
#include <llarp/mem.h>
|
|
|
|
namespace llarp {
|
|
void *std_malloc(size_t sz, size_t align) {
|
|
(void)align;
|
|
void *ptr = malloc(sz);
|
|
if (ptr)
|
|
return ptr;
|
|
abort();
|
|
}
|
|
|
|
void std_free(void *ptr) {
|
|
if (ptr)
|
|
free(ptr);
|
|
}
|
|
|
|
} // namespace llarp
|
|
|
|
extern "C" {
|
|
void llarp_mem_std() {
|
|
llarp_g_mem.alloc = llarp::std_malloc;
|
|
llarp_g_mem.free = llarp::std_free;
|
|
}
|
|
}
|