Merge pull request #211 from michael-loki/mem_std_dead

remove dead mem_std file
This commit is contained in:
Jeff 2019-01-10 16:35:24 -05:00 committed by GitHub
commit d09d443515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,43 +0,0 @@
#define NO_JEMALLOC
#include <mem.h>
#include <cstdlib>
#include <cstring>
struct llarp_alloc
{
void *(*alloc)(struct llarp_alloc *mem, size_t sz, size_t align);
void (*free)(struct llarp_alloc *mem, void *ptr);
};
namespace llarp
{
void *
std_malloc(struct llarp_alloc *mem, size_t sz, size_t align)
{
(void)mem;
(void)align;
void *ptr = malloc(sz);
if(ptr)
{
std::memset(ptr, 0, sz);
return ptr;
}
abort();
}
void
std_free(struct llarp_alloc *mem, void *ptr)
{
(void)mem;
if(ptr)
free(ptr);
}
} // namespace llarp
void
llarp_mem_stdlib(struct llarp_alloc *mem)
{
mem->alloc = llarp::std_malloc;
mem->free = llarp::std_free;
}