#include #include #include "paf_heapMgr.h" Int gPafHeapIdInt = PAF_HEAP_ID_INT; Int gPafHeapIdInt1 = PAF_HEAP_ID_INT1; Int gPafHeapIdExt = PAF_HEAP_ID_EXT; Int gPafHeapIdInt1Shm = PAF_HEAP_ID_INT1_SHM; Int gPafHeapIdExtShm = PAF_HEAP_ID_EXT_SHM; // heap handle array //static IHeap_Handle gHeapIdToHandle[PAF_NUM_HEAPS] = IHeap_Handle gHeapIdToHandle[PAF_NUM_HEAPS] = { NULL, NULL, NULL, NULL, NULL }; /* Initialize PAF heap manager */ Void pafHeapMgr_init( IHeap_Handle hIntHeap, IHeap_Handle hIntHeap1, IHeap_Handle hExtHeap, IHeap_Handle hIntHeap1Shm, IHeap_Handle hExtHeapShm ) { gHeapIdToHandle[PAF_HEAP_ID_INT] = hIntHeap; gHeapIdToHandle[PAF_HEAP_ID_INT1] = hIntHeap1; gHeapIdToHandle[PAF_HEAP_ID_EXT] = hExtHeap; gHeapIdToHandle[PAF_HEAP_ID_INT1_SHM] = hIntHeap1Shm; gHeapIdToHandle[PAF_HEAP_ID_EXT_SHM] = hExtHeapShm; } /* Write heap handle to PAF heap manager for provided index */ Void pafHeapMgr_writeHeapHandle( Int heapId, IHeap_Handle hHeap ) { if (heapId < PAF_NUM_HEAPS) { gHeapIdToHandle[heapId] = hHeap; } } /* Read heap handle from PAF heap manager for provided index */ IHeap_Handle pafHeapMgr_readHeapHandle( Int heapId ) { IHeap_Handle hHeap; if (heapId < PAF_NUM_HEAPS) { hHeap = gHeapIdToHandle[heapId]; } else { hHeap = NULL; } return hHeap; }