1 /*
2  * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /*
8  * @file	alloc.h
9  * @brief	Memory allocation handling primitives for libmetal.
10  */
11 
12 #ifndef __METAL_ALLOC__H__
13 #define __METAL_ALLOC__H__
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /** \defgroup Memory Allocation Interfaces
20  *  @{ */
21 
22 /**
23  * @brief      allocate requested memory size
24  *             return a pointer to the allocated memory
25  *
26  * @param[in]  size        size in byte of requested memory
27  * @return     memory pointer, or 0 if it failed to allocate
28  */
29 static inline void *metal_allocate_memory(unsigned int size);
30 
31 /**
32  * @brief      free the memory previously allocated
33  *
34  * @param[in]  ptr       pointer to memory
35  */
36 static inline void metal_free_memory(void *ptr);
37 
38 #include <metal/system/generic/alloc.h>
39 
40 /** @} */
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif /* __METAL_ALLOC__H__ */
47