test: add an spdk_malloc implementation for test_env

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6f738d510fde00d5d068dd530885d8b0b5e17035
This commit is contained in:
Jim Harris 2017-02-08 11:43:02 -07:00 committed by Daniel Verkamp
parent 5efd4b8800
commit d0d946ddb4

View File

@ -39,7 +39,7 @@
#include "spdk/env.h"
void *
spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr)
spdk_malloc(size_t size, size_t align, uint64_t *phys_addr)
{
void *buf = NULL;
if (posix_memalign(&buf, align, size)) {
@ -51,6 +51,17 @@ spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr)
return buf;
}
void *
spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr)
{
void *buf = spdk_malloc(size, align, phys_addr);
if (buf != NULL) {
memset(buf, 0, size);
}
return buf;
}
void *
spdk_realloc(void *buf, size_t size, size_t align, uint64_t *phys_addr)
{