32 #ifndef _CL_HEAP_API_H_
33 #define _CL_HEAP_API_H_
39 #include <clPoolIpi.h>
40 #include <clMemStats.h>
260 ClRcT clHeapInit(
void);
262 ClRcT clHeapExit(
void);
544 CL_IN ClPtrT (*reallocHook)(ClPtrT ,ClUint32T),
545 CL_IN ClPtrT (*callocHook)(ClUint32T,ClUint32T),
546 CL_IN void (*freeHook)(ClPtrT )
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
ClRcT clHeapHooksDeregister(void)
De-registers the hooks registered for CL_HEAP_CUSTOM_MODE.
ClRcT clHeapModeGet(CL_OUT ClHeapModeT *pMode)
Returns the mode set during configuration.
ClRcT clHeapHooksRegister(CL_IN ClPtrT(*allocHook)(ClUint32T), CL_IN ClPtrT(*reallocHook)(ClPtrT, ClUint32T), CL_IN ClPtrT(*callocHook)(ClUint32T, ClUint32T), CL_IN void(*freeHook)(ClPtrT))
Register functions to be used in CL_HEAP_CUSTOM_MODE.
void clHeapFree(CL_IN ClPtrT pAddress)
Frees a pre-allocated memory.
ClPtrT clHeapAllocate(CL_IN ClUint32T size)
Allocates memory of the requested size.
ClRcT clHeapLibCustomInitialize(const ClHeapConfigT *pHeapConfig)
Customizes the initialization of heap library in CL_HEAP_CUSTOM_MODE.
ClRcT clHeapLibCustomFinalize(void)
Customizes the finalization of heap library in CL_HEAP_CUSTOM_MODE.
ClPtrT clHeapRealloc(CL_IN ClPtrT pAddress, CL_IN ClUint32T size)
Changes the size of the memory block (chunk).
ClRcT clHeapStatsGet(CL_OUT ClMemStatsT *pHeapStats)
Returns the statistics collected by heap module.
ClRcT clHeapLibInitialize(CL_IN const ClHeapConfigT *pHeapConfig)
Initializes the heap library.
ClRcT clHeapPoolStatsGet(CL_IN ClUint32T numPools, CL_OUT ClUint32T *pPoolSize, CL_OUT ClPoolStatsT *pHeapPoolStats)
Returns the statistics collected by heap library for an individual pool.
ClHeapModeT
Heap Allocation modes.
Definition: clHeapApi.h:45
ClPtrT clHeapCalloc(CL_IN ClUint32T numChunks, CL_IN ClUint32T chunkSize)
Allocates memory for an array and initializes it to zero.
ClRcT clHeapShrink(CL_IN const ClPoolShrinkOptionsT *pShrinkOptions)
Shrinks the configured pools of memory.
ClRcT clHeapLibFinalize(void)
Finalizes the heap library.
@ CL_HEAP_PREALLOCATED_MODE
OpenClovis implementation of the memory management library.
Definition: clHeapApi.h:49
@ CL_HEAP_NATIVE_MODE
Native C mode.
Definition: clHeapApi.h:54
@ CL_HEAP_CUSTOM_MODE
Custom pools.
Definition: clHeapApi.h:60
ClHeapConfigT to be fetched by EO and contains the configuration of the heap library.
Definition: clHeapApi.h:68
ClHeapModeT mode
Allocation mode.
Definition: clHeapApi.h:73
ClPoolConfigT * pPoolConfig
Array of pool configurations.
Definition: clHeapApi.h:93
ClUint32T numPools
Number of pools in the pPoolConfig array.
Definition: clHeapApi.h:98
ClBoolT lazy
A pool can grow even after it exhausts its current allocation.
Definition: clHeapApi.h:88