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 19 /** 20 * @brief File Description: 21 * This file contains wrappers for memory operations APIs. 22 */ 23 24 25 /*---------------------------- 26 PUBLIC FUNCTIONS 27 -----------------------------------*/ 28 29 /*! 30 * @brief This function purpose is to allocate a memory buffer according to aSize. 31 * 32 * 33 * @return The function returns a pointer to allocated buffer or NULL if allocation failed. 34 */ 35 void* CC_PalMemMallocPlat(size_t aSize /*!< [in] Number of bytes to allocate. */); 36 37 /*! 38 * @brief This function purpose is to reallocate a memory buffer according to aNewSize. 39 * The content of the old buffer is moved to the new location. 40 * 41 * @return The function returns a pointer to the newly allocated buffer or NULL if allocation failed. 42 */ 43 void* CC_PalMemReallocPlat( void* aBuffer, /*!< [in] Pointer to allocated buffer. */ 44 size_t aNewSize /*!< [in] Number of bytes to reallocate. */); 45 46 /*! 47 * @brief This function purpose is to free allocated buffer. 48 * 49 * 50 * @return void. 51 */ 52 void CC_PalMemFreePlat(void* aBuffer /*!< [in] Pointer to allocated buffer.*/); 53 #ifdef __cplusplus 54 } 55 #endif 56 57 #endif 58 59 60