Commit d0d946dd authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

test: add an spdk_malloc implementation for test_env



Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I6f738d510fde00d5d068dd530885d8b0b5e17035
parent 5efd4b88
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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)
{