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