OpenClovis Logo

clHeapApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 
32 #ifndef _CL_HEAP_API_H_
33 #define _CL_HEAP_API_H_
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <clPoolIpi.h>
40 #include <clMemStats.h>
41 
45 typedef enum {
50 
55 
61 
62 } ClHeapModeT;
63 
68 typedef struct {
74 
88  ClBoolT lazy;
89 
93  ClPoolConfigT *pPoolConfig;
94 
98  ClUint32T numPools;
100 
101 /*****************************************************************************
102  * Functions
103  *****************************************************************************/
104 
136 ClPtrT clHeapAllocate(CL_IN ClUint32T size);
161 void clHeapFree(CL_IN ClPtrT pAddress);
188 ClPtrT clHeapCalloc(CL_IN ClUint32T numChunks,CL_IN ClUint32T chunkSize);
189 /*****************************************************************************/
190 
191 #ifndef __KERNEL__
192 /*****************************************************************************/
228 ClRcT clHeapLibInitialize(CL_IN const ClHeapConfigT *pHeapConfig);
229 /*****************************************************************************/
230 
259 /*****************************************************************************/
260 ClRcT clHeapInit(void);
261 /*****************************************************************************/
262 ClRcT clHeapExit(void);
263 /*****************************************************************************/
264 
304 ClPtrT clHeapRealloc(CL_IN ClPtrT pAddress,CL_IN ClUint32T size);
305 /*****************************************************************************/
306 
332 ClRcT clHeapShrink(CL_IN const ClPoolShrinkOptionsT *pShrinkOptions);
333 /*****************************************************************************/
334 
362 /*****************************************************************************/
363 
387 ClRcT clHeapStatsGet(CL_OUT ClMemStatsT *pHeapStats);
388 /*****************************************************************************/
389 
426 ClRcT clHeapPoolStatsGet(CL_IN ClUint32T numPools,CL_OUT ClUint32T *pPoolSize,CL_OUT ClPoolStatsT *pHeapPoolStats);
427 /*****************************************************************************/
428 
462 ClRcT clHeapLibCustomInitialize(const ClHeapConfigT *pHeapConfig);
463 /*****************************************************************************/
464 
498 /*****************************************************************************/
499 
543 ClRcT clHeapHooksRegister(CL_IN ClPtrT (*allocHook) (ClUint32T),
544  CL_IN ClPtrT (*reallocHook)(ClPtrT ,ClUint32T),
545  CL_IN ClPtrT (*callocHook)(ClUint32T,ClUint32T),
546  CL_IN void (*freeHook)(ClPtrT )
547  );
548 /*****************************************************************************/
549 
584 /*****************************************************************************/
585 
586 #endif
587 
588 #ifdef __cplusplus
589 }
590 #endif
591 
592 #endif
593 

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen