Files
libmetal/test/system/zephyr/alloc.c
T
Gerard Marull-Paretas e9d4531300 zephyr: update include paths to use <zephyr/...>
Zephyr has prefixed all of its includes with <zephyr/...>. While the old
mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still enabled
by default, it's better to be prepared for its removal in the future.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-05-16 10:27:20 +02:00

31 lines
539 B
C

/*
* Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdlib.h>
#include <metal/alloc.h>
#include <metal/errno.h>
#include <metal/log.h>
#include <metal/sys.h>
#include <zephyr/sys/printk.h>
#include "metal-test-internal.h"
static int alloc(void)
{
void *ptr;
ptr = metal_allocate_memory(1000);
if (!ptr) {
metal_log(METAL_LOG_DEBUG, "failed to allocate memory\n");
return -errno;
}
metal_free_memory(ptr);
return 0;
}
METAL_ADD_TEST(alloc);