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.cpp

36 lines
588 B
C++

#include <llarp/mem.h>
namespace llarp
{
void Zero(void * ptr, size_t sz)
{
uint8_t * p = (uint8_t *) ptr;
while(sz--)
{
*p = 0;
++p;
}
}
}
extern "C" {
void llarp_mem_slab(struct llarp_alloc * mem, uint32_t * buf, size_t sz)
{
// not implemented
abort();
}
bool llarp_eq(const void * a, const void * b, size_t sz)
{
bool result = true;
const uint8_t * a_ptr = (const uint8_t *) a;
const uint8_t * b_ptr = (const uint8_t *) b;
while(sz--)
{
result &= a_ptr[sz] == b_ptr[sz];
}
return result;
}
}