1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 
8 #ifndef _CC_PAL_MEMALLOC_INT_H
9 #define _CC_PAL_MEMALLOC_INT_H
10 
11 
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16 
17 #include <stdlib.h>
18 #include "FreeRTOS.h"
19 
20 /**
21 * @brief File Description:
22 *        This file contains wrappers for memory operations APIs.
23 */
24 
25 
26 /*----------------------------
27       PUBLIC FUNCTIONS
28 -----------------------------------*/
29 
30 /*!
31  * @brief This function purpose is to allocate a memory buffer according to aSize.
32  *
33  *
34  * @return The function returns a pointer to allocated buffer or NULL if allocation failed.
35  */
36 void* CC_PalMemMallocPlat(size_t  aSize /*!< [in] Number of bytes to allocate. */);
37 
38 /*!
39  * @brief This function purpose is to reallocate a memory buffer according to aNewSize.
40  *        The content of the old buffer is moved to the new location.
41  *
42  * @return The function returns a pointer to the newly allocated buffer or NULL if allocation failed.
43  */
44 void* CC_PalMemReallocPlat(  void* aBuffer,     /*!< [in] Pointer to allocated buffer. */
45                              size_t  aNewSize   /*!< [in] Number of bytes to reallocate. */);
46 
47 /*!
48  * @brief This function purpose is to free allocated buffer.
49  *
50  *
51  * @return void.
52  */
53 void CC_PalMemFreePlat(void* aBuffer /*!< [in] Pointer to allocated buffer.*/);
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
59 
60 
61