Lines Matching refs:heap

356 void   *OS_AllocFromHeap(OSArenaId id, OSHeapHandle heap, u32 size)  in OS_AllocFromHeap()  argument
384 if (heap < 0) in OS_AllocFromHeap()
386 heap = heapInfo->currentHeap; in OS_AllocFromHeap()
391 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_ALLOCFROMHEAP_INVHEAP); in OS_AllocFromHeap()
392 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_ALLOCFROMHEAP_INVHEAP); in OS_AllocFromHeap()
394 hd = &heapInfo->heapArray[heap]; in OS_AllocFromHeap()
667 void OS_FreeToHeap(OSArenaId id, OSHeapHandle heap, void *ptr) in OS_FreeToHeap() argument
680 if (heap < 0) in OS_FreeToHeap()
682 heap = heapInfo->currentHeap; in OS_FreeToHeap()
690 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_FREETOHEAP_INVHEAP); in OS_FreeToHeap()
693 hd = &heapInfo->heapArray[heap]; in OS_FreeToHeap()
724 void OS_FreeAllToHeap(OSArenaId id, OSHeapHandle heap) in OS_FreeAllToHeap() argument
737 if (heap < 0) in OS_FreeAllToHeap()
739 heap = heapInfo->currentHeap; in OS_FreeAllToHeap()
743 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, "invalid heap handle"); in OS_FreeAllToHeap()
745 hd = &heapInfo->heapArray[heap]; in OS_FreeAllToHeap()
780 OSHeapHandle OS_SetCurrentHeap(OSArenaId id, OSHeapHandle heap) in OS_SetCurrentHeap() argument
792 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_SETCURRENTHEAP_INVHEAP); in OS_SetCurrentHeap()
793 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_SETCURRENTHEAP_INVHEAP); in OS_SetCurrentHeap()
795 heapInfo->currentHeap = heap; in OS_SetCurrentHeap()
903 OSHeapHandle heap; in OS_CreateHeap() local
927 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateHeap()
929 if (heapInfo->heapArray[heap].size < 0) in OS_CreateHeap()
933 SDK_ASSERTMSG(!DLOverlap(heapInfo->heapArray[heap].free, start, end), in OS_CreateHeap()
935 SDK_ASSERTMSG(!DLOverlap(heapInfo->heapArray[heap].allocated, start, end), in OS_CreateHeap()
941 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateHeap()
943 hd = &heapInfo->heapArray[heap]; in OS_CreateHeap()
963 return heap; in OS_CreateHeap()
988 void OS_DestroyHeap(OSArenaId id, OSHeapHandle heap) in OS_DestroyHeap() argument
1003 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_DESTROYHEAP_INVHEAP); in OS_DestroyHeap()
1004 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_DESTROYHEAP_INVHEAP); in OS_DestroyHeap()
1006 hd = &heapInfo->heapArray[heap]; in OS_DestroyHeap()
1013 OS_Printf("OS_DestroyHeap(%d): Warning - free list size %d, heap size %d\n", heap, size, in OS_DestroyHeap()
1023 if (heapInfo->currentHeap == heap) in OS_DestroyHeap()
1046 void OS_AddToHeap(OSArenaId id, OSHeapHandle heap, void *start, void *end) in OS_AddToHeap() argument
1062 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_ADDTOHEAP_INVHEAP); in OS_AddToHeap()
1063 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_ADDTOHEAP_INVHEAP); in OS_AddToHeap()
1065 hd = &heapInfo->heapArray[heap]; in OS_AddToHeap()
1149 s32 OS_CheckHeap(OSArenaId id, OSHeapHandle heap) in OS_CheckHeap() argument
1165 if (heap == OS_CURRENT_HEAP_HANDLE) in OS_CheckHeap()
1167 heap = heapInfo->currentHeap; in OS_CheckHeap()
1169 SDK_ASSERT(heap >= 0); in OS_CheckHeap()
1172 OSi_CHECK(0 <= heap && heap < heapInfo->numHeaps); in OS_CheckHeap()
1174 hd = &heapInfo->heapArray[heap]; in OS_CheckHeap()
1274 void OS_DumpHeap(OSArenaId id, OSHeapHandle heap) in OS_DumpHeap() argument
1290 if (heap < 0) in OS_DumpHeap()
1292 heap = heapInfo->currentHeap; in OS_DumpHeap()
1294 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_DUMPHEAP_INVHEAP); in OS_DumpHeap()
1296 hd = &heapInfo->heapArray[heap]; in OS_DumpHeap()
1303 SDK_ASSERTMSG(0 <= OS_CheckHeap(id, heap), OS_ERR_DUMPHEAP_BROKENHEAP); in OS_DumpHeap()
1346 #pragma unused( id, heap ) in OS_DumpHeap()
1366 u32 heap; in OS_VisitAllocated() local
1376 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_VisitAllocated()
1378 if (heapInfo->heapArray[heap].size >= 0) in OS_VisitAllocated()
1380 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OS_VisitAllocated()
1405 u32 OSi_GetTotalAllocSize(OSArenaId id, OSHeapHandle heap, BOOL isHeadInclude) in OSi_GetTotalAllocSize() argument
1415 SDK_ASSERT(heap < heapInfo->numHeaps); in OSi_GetTotalAllocSize()
1418 if (heap < 0) in OSi_GetTotalAllocSize()
1420 heap = heapInfo->currentHeap; in OSi_GetTotalAllocSize()
1425 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OSi_GetTotalAllocSize()
1432 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OSi_GetTotalAllocSize()
1454 u32 OS_GetTotalFreeSize(OSArenaId id, OSHeapHandle heap) in OS_GetTotalFreeSize() argument
1464 SDK_ASSERT(heap < heapInfo->numHeaps); in OS_GetTotalFreeSize()
1467 if (heap < 0) in OS_GetTotalFreeSize()
1469 heap = heapInfo->currentHeap; in OS_GetTotalFreeSize()
1472 for (cell = heapInfo->heapArray[heap].free; cell; cell = cell->next) in OS_GetTotalFreeSize()
1492 u32 OS_GetMaxFreeSize(OSArenaId id, OSHeapHandle heap) in OS_GetMaxFreeSize() argument
1502 SDK_ASSERT(heap < heapInfo->numHeaps); in OS_GetMaxFreeSize()
1505 if (heap < 0) in OS_GetMaxFreeSize()
1507 heap = heapInfo->currentHeap; in OS_GetMaxFreeSize()
1510 for (cell = heapInfo->heapArray[heap].free; cell; cell = cell->next) in OS_GetMaxFreeSize()
1537 void OS_ClearHeap(OSArenaId id, OSHeapHandle heap, void *start, void *end) in OS_ClearHeap() argument
1560 if (heap < 0) in OS_ClearHeap()
1562 heap = heapInfo->currentHeap; in OS_ClearHeap()
1566 hd = &heapInfo->heapArray[heap]; in OS_ClearHeap()