Lines Matching refs:heap
360 void *OS_AllocFromHeap(OSArenaId id, OSHeapHandle heap, u32 size) in OS_AllocFromHeap() argument
388 if (heap < 0) in OS_AllocFromHeap()
390 heap = heapInfo->currentHeap; in OS_AllocFromHeap()
395 SDK_TASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_ALLOCFROMHEAP_INVHEAP); in OS_AllocFromHeap()
396 SDK_TASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_ALLOCFROMHEAP_INVHEAP); in OS_AllocFromHeap()
398 hd = &heapInfo->heapArray[heap]; in OS_AllocFromHeap()
673 void OS_FreeToHeap(OSArenaId id, OSHeapHandle heap, void *ptr) in OS_FreeToHeap() argument
686 if (heap < 0) in OS_FreeToHeap()
688 heap = heapInfo->currentHeap; in OS_FreeToHeap()
694 if ( OSi_ExtraHeapArenaId != id || OSi_ExtraHeapHandle != heap ) in OS_FreeToHeap()
703 SDK_TASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_FREETOHEAP_INVHEAP); in OS_FreeToHeap()
706 hd = &heapInfo->heapArray[heap]; in OS_FreeToHeap()
737 void OS_FreeAllToHeap(OSArenaId id, OSHeapHandle heap) in OS_FreeAllToHeap() argument
750 if (heap < 0) in OS_FreeAllToHeap()
752 heap = heapInfo->currentHeap; in OS_FreeAllToHeap()
756 SDK_TASSERTMSG(0 <= heapInfo->heapArray[heap].size, "invalid heap handle"); in OS_FreeAllToHeap()
758 hd = &heapInfo->heapArray[heap]; in OS_FreeAllToHeap()
793 OSHeapHandle OS_SetCurrentHeap(OSArenaId id, OSHeapHandle heap) in OS_SetCurrentHeap() argument
805 SDK_TASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_SETCURRENTHEAP_INVHEAP); in OS_SetCurrentHeap()
806 SDK_TASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_SETCURRENTHEAP_INVHEAP); in OS_SetCurrentHeap()
808 heapInfo->currentHeap = heap; in OS_SetCurrentHeap()
914 OSHeapHandle heap; in OS_CreateHeap() local
937 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateHeap()
939 if (heapInfo->heapArray[heap].size < 0) in OS_CreateHeap()
943 …SDK_TASSERTMSG(!DLOverlap(heapInfo->heapArray[heap].free, start, end), OS_ERR_CREATEHEAP_INVRANGE); in OS_CreateHeap()
944 …SDK_TASSERTMSG(!DLOverlap(heapInfo->heapArray[heap].allocated, start, end), OS_ERR_CREATEHEAP_INVR… in OS_CreateHeap()
949 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateHeap()
951 hd = &heapInfo->heapArray[heap]; in OS_CreateHeap()
971 return heap; in OS_CreateHeap()
1000 OSHeapHandle heap; in OS_CreateExtraHeap() local
1015 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateExtraHeap()
1017 hd = &heapInfo->heapArray[heap]; in OS_CreateExtraHeap()
1036 OSi_ExtraHeapHandle = heap; in OS_CreateExtraHeap()
1039 return heap; in OS_CreateExtraHeap()
1062 void OS_DestroyHeap(OSArenaId id, OSHeapHandle heap) in OS_DestroyHeap() argument
1077 SDK_TASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_DESTROYHEAP_INVHEAP); in OS_DestroyHeap()
1078 SDK_TASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_DESTROYHEAP_INVHEAP); in OS_DestroyHeap()
1080 hd = &heapInfo->heapArray[heap]; in OS_DestroyHeap()
1087 …OS_TPrintf("OS_DestroyHeap(%d): Warning - free list size %d, heap size %d\n", heap, size, hd->size… in OS_DestroyHeap()
1093 if ( OSi_ExtraHeapArenaId == id && OSi_ExtraHeapHandle == heap ) in OS_DestroyHeap()
1105 if (heapInfo->currentHeap == heap) in OS_DestroyHeap()
1128 void OS_AddToHeap(OSArenaId id, OSHeapHandle heap, void *start, void *end) in OS_AddToHeap() argument
1144 SDK_TASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_ADDTOHEAP_INVHEAP); in OS_AddToHeap()
1145 SDK_TASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_ADDTOHEAP_INVHEAP); in OS_AddToHeap()
1147 hd = &heapInfo->heapArray[heap]; in OS_AddToHeap()
1207 void OS_AddExtraAreaToHeap(OSArenaId id, OSHeapHandle heap) in OS_AddExtraAreaToHeap() argument
1211 OS_AddToHeap(id, heap, in OS_AddExtraAreaToHeap()
1215 OSi_ExtraHeapHandle = heap; in OS_AddExtraAreaToHeap()
1265 s32 OS_CheckHeap(OSArenaId id, OSHeapHandle heap) in OS_CheckHeap() argument
1281 if (heap == OS_CURRENT_HEAP_HANDLE) in OS_CheckHeap()
1283 heap = heapInfo->currentHeap; in OS_CheckHeap()
1285 SDK_ASSERT(heap >= 0); in OS_CheckHeap()
1288 OSi_CHECK(0 <= heap && heap < heapInfo->numHeaps); in OS_CheckHeap()
1290 hd = &heapInfo->heapArray[heap]; in OS_CheckHeap()
1298 if ( OSi_ExtraHeapArenaId != id || OSi_ExtraHeapHandle != heap ) in OS_CheckHeap()
1325 if ( OSi_ExtraHeapArenaId != id || OSi_ExtraHeapHandle != heap ) in OS_CheckHeap()
1413 void OS_DumpHeap(OSArenaId id, OSHeapHandle heap) in OS_DumpHeap() argument
1429 if (heap < 0) in OS_DumpHeap()
1431 heap = heapInfo->currentHeap; in OS_DumpHeap()
1433 SDK_TASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_DUMPHEAP_INVHEAP); in OS_DumpHeap()
1435 hd = &heapInfo->heapArray[heap]; in OS_DumpHeap()
1442 SDK_TASSERTMSG(0 <= OS_CheckHeap(id, heap), OS_ERR_DUMPHEAP_BROKENHEAP); in OS_DumpHeap()
1487 #pragma unused( id, heap ) in OS_DumpHeap()
1507 u32 heap; in OS_VisitAllocated() local
1517 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_VisitAllocated()
1519 if (heapInfo->heapArray[heap].size >= 0) in OS_VisitAllocated()
1521 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OS_VisitAllocated()
1546 u32 OSi_GetTotalAllocSize(OSArenaId id, OSHeapHandle heap, BOOL isHeadInclude) in OSi_GetTotalAllocSize() argument
1556 SDK_ASSERT(heap < heapInfo->numHeaps); in OSi_GetTotalAllocSize()
1559 if (heap < 0) in OSi_GetTotalAllocSize()
1561 heap = heapInfo->currentHeap; in OSi_GetTotalAllocSize()
1566 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OSi_GetTotalAllocSize()
1573 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OSi_GetTotalAllocSize()
1595 u32 OS_GetTotalFreeSize(OSArenaId id, OSHeapHandle heap) in OS_GetTotalFreeSize() argument
1605 SDK_ASSERT(heap < heapInfo->numHeaps); in OS_GetTotalFreeSize()
1608 if (heap < 0) in OS_GetTotalFreeSize()
1610 heap = heapInfo->currentHeap; in OS_GetTotalFreeSize()
1613 for (cell = heapInfo->heapArray[heap].free; cell; cell = cell->next) in OS_GetTotalFreeSize()
1633 u32 OS_GetMaxFreeSize(OSArenaId id, OSHeapHandle heap) in OS_GetMaxFreeSize() argument
1643 SDK_ASSERT(heap < heapInfo->numHeaps); in OS_GetMaxFreeSize()
1646 if (heap < 0) in OS_GetMaxFreeSize()
1648 heap = heapInfo->currentHeap; in OS_GetMaxFreeSize()
1651 for (cell = heapInfo->heapArray[heap].free; cell; cell = cell->next) in OS_GetMaxFreeSize()
1680 void OS_ClearHeap(OSArenaId id, OSHeapHandle heap, void *start, void *end) in OS_ClearHeap() argument
1700 if ( OSi_ExtraHeapArenaId != id || OSi_ExtraHeapHandle != heap ) in OS_ClearHeap()
1711 if (heap < 0) in OS_ClearHeap()
1713 heap = heapInfo->currentHeap; in OS_ClearHeap()
1717 hd = &heapInfo->heapArray[heap]; in OS_ClearHeap()
1747 void OS_ClearExtraHeap(OSArenaId id, OSHeapHandle heap) in OS_ClearExtraHeap() argument
1751 if ( OSi_ExtraHeapArenaId == id || OSi_ExtraHeapHandle == heap ) in OS_ClearExtraHeap()
1753 OS_ClearHeap(id, heap, in OS_ClearExtraHeap()