Lines Matching refs:hd

113     HeapDesc *hd;                      // from which the block is allocated  member
363 HeapDesc *hd; in OS_AllocFromHeap() local
398 hd = &heapInfo->heapArray[heap]; in OS_AllocFromHeap()
405 for (cell = hd->free; cell != NULL; cell = cell->next) in OS_AllocFromHeap()
423 SDK_TASSERTMSG(cell->hd == NULL, OS_ERR_ALLOCFROMHEAP_BROKENHEAP); in OS_AllocFromHeap()
429 hd->free = DLExtract(hd->free, cell); in OS_AllocFromHeap()
440 newCell->hd = NULL; in OS_AllocFromHeap()
458 SDK_TASSERTMSG(hd->free == cell, OS_ERR_ALLOCFROMHEAP_BROKENHEAP); in OS_AllocFromHeap()
459 hd->free = newCell; in OS_AllocFromHeap()
464 hd->allocated = DLAddFront(hd->allocated, cell); in OS_AllocFromHeap()
467 cell->hd = hd; in OS_AllocFromHeap()
469 hd->headerBytes += HEADERSIZE; in OS_AllocFromHeap()
470 hd->paddingBytes += cell->size - (HEADERSIZE + requested); in OS_AllocFromHeap()
471 hd->payloadBytes += requested; in OS_AllocFromHeap()
500 HeapDesc *hd; in OS_AllocFixed() local
517 hd = &heapInfo->heapArray[i]; in OS_AllocFixed()
518 if (hd->size < 0) // Is inactive? in OS_AllocFixed()
523 if (DLOverlap(hd->allocated, start, end)) in OS_AllocFixed()
544 hd = &heapInfo->heapArray[i]; in OS_AllocFixed()
546 if (hd->size < 0) // Is inactive? in OS_AllocFixed()
551 for (cell = hd->free; cell; cell = cell->next) in OS_AllocFixed()
577 hd->free = DLExtract(hd->free, cell); // Note cell->next is intact. XXX in OS_AllocFixed()
578 hd->size -= cell->size; // Update stats in OS_AllocFixed()
596 newCell->hd = NULL; in OS_AllocFixed()
610 hd->free = newCell; // new head in OS_AllocFixed()
612 hd->size -= (char *)end - (char *)cell; in OS_AllocFixed()
625 hd->size -= (char *)cellEnd - (char *)start; in OS_AllocFixed()
635 newCell->hd = NULL; in OS_AllocFixed()
645 hd->size -= (char *)end - (char *)start; in OS_AllocFixed()
648 SDK_ASSERT(0 <= hd->size); in OS_AllocFixed()
676 HeapDesc *hd; in OS_FreeToHeap() local
706 hd = &heapInfo->heapArray[heap]; in OS_FreeToHeap()
708 SDK_TASSERTMSG(cell->hd == hd, OS_ERR_FREETOHEAP_INVPTR); in OS_FreeToHeap()
709 SDK_TASSERTMSG(DLLookup(hd->allocated, cell), OS_ERR_FREETOHEAP_INVPTR); in OS_FreeToHeap()
712 cell->hd = NULL; in OS_FreeToHeap()
713 hd->headerBytes -= HEADERSIZE; in OS_FreeToHeap()
714 hd->paddingBytes -= cell->size - (HEADERSIZE + cell->requested); in OS_FreeToHeap()
715 hd->payloadBytes -= cell->requested; in OS_FreeToHeap()
719 hd->allocated = DLExtract(hd->allocated, cell); in OS_FreeToHeap()
722 hd->free = DLInsert(hd->free, cell); in OS_FreeToHeap()
740 HeapDesc *hd; in OS_FreeAllToHeap() local
758 hd = &heapInfo->heapArray[heap]; in OS_FreeAllToHeap()
759 while ((cell = hd->allocated) != NULL) in OS_FreeAllToHeap()
761 SDK_ASSERT(cell->hd == hd); in OS_FreeAllToHeap()
762 SDK_ASSERT(DLLookup(hd->allocated, cell)); in OS_FreeAllToHeap()
765 cell->hd = NULL; in OS_FreeAllToHeap()
766 hd->headerBytes -= HEADERSIZE; in OS_FreeAllToHeap()
767 hd->paddingBytes -= cell->size - (HEADERSIZE + cell->requested); in OS_FreeAllToHeap()
768 hd->payloadBytes -= cell->requested; in OS_FreeAllToHeap()
772 hd->allocated = DLExtract(hd->allocated, cell); in OS_FreeAllToHeap()
775 hd->free = DLInsert(hd->free, cell); in OS_FreeAllToHeap()
856 HeapDesc *hd = &heapInfo->heapArray[i]; in OS_InitAlloc() local
858 hd->size = -1; in OS_InitAlloc()
859 hd->free = hd->allocated = NULL; in OS_InitAlloc()
861 hd->paddingBytes = hd->headerBytes = hd->payloadBytes = 0; in OS_InitAlloc()
915 HeapDesc *hd; in OS_CreateHeap() local
951 hd = &heapInfo->heapArray[heap]; in OS_CreateHeap()
952 if (hd->size < 0) in OS_CreateHeap()
954 hd->size = (char *)end - (char *)start; in OS_CreateHeap()
959 cell->size = hd->size; in OS_CreateHeap()
961 cell->hd = NULL; in OS_CreateHeap()
964 hd->free = cell; in OS_CreateHeap()
965 hd->allocated = 0; in OS_CreateHeap()
967 hd->paddingBytes = hd->headerBytes = hd->payloadBytes = 0; in OS_CreateHeap()
1001 HeapDesc *hd; in OS_CreateExtraHeap() local
1017 hd = &heapInfo->heapArray[heap]; in OS_CreateExtraHeap()
1018 if (hd->size < 0) in OS_CreateExtraHeap()
1020 hd->size = HW_MAIN_MEM_PARAMETER_BUF_SIZE; in OS_CreateExtraHeap()
1028 cell->hd = NULL; in OS_CreateExtraHeap()
1030 hd->free = cell; in OS_CreateExtraHeap()
1031 hd->allocated = 0; in OS_CreateExtraHeap()
1033 hd->paddingBytes = hd->headerBytes = hd->payloadBytes = 0; in OS_CreateExtraHeap()
1065 HeapDesc *hd; in OS_DestroyHeap() local
1080 hd = &heapInfo->heapArray[heap]; in OS_DestroyHeap()
1084 size = DLSize(hd->free); in OS_DestroyHeap()
1085 if (hd->size != size) in OS_DestroyHeap()
1087 …S_TPrintf("OS_DestroyHeap(%d): Warning - free list size %d, heap size %d\n", heap, size, hd->size); in OS_DestroyHeap()
1100 hd->size = -1; in OS_DestroyHeap()
1101 hd->free = hd->allocated = NULL; // add to dolphin src in OS_DestroyHeap()
1104 hd->paddingBytes = hd->headerBytes = hd->payloadBytes = 0; in OS_DestroyHeap()
1131 HeapDesc *hd; in OS_AddToHeap() local
1147 hd = &heapInfo->heapArray[heap]; in OS_AddToHeap()
1184 cell->hd = NULL; in OS_AddToHeap()
1188 hd->size += cell->size; in OS_AddToHeap()
1189 hd->free = DLInsert(hd->free, cell); in OS_AddToHeap()
1268 HeapDesc *hd; in OS_CheckHeap() local
1290 hd = &heapInfo->heapArray[heap]; in OS_CheckHeap()
1291 OSi_CHECK(0 <= hd->size); in OS_CheckHeap()
1293 OSi_CHECK(hd->allocated == NULL || hd->allocated->prev == NULL); in OS_CheckHeap()
1294 for (cell = hd->allocated; cell; cell = cell->next) in OS_CheckHeap()
1312 OSi_CHECK(0 < total && total <= hd->size); in OS_CheckHeap()
1315 OSi_CHECK(cell->hd == hd); in OS_CheckHeap()
1320 OSi_CHECK(hd->free == NULL || hd->free->prev == NULL); in OS_CheckHeap()
1321 for (cell = hd->free; cell; cell = cell->next) in OS_CheckHeap()
1341 OSi_CHECK(0 < total && total <= hd->size); in OS_CheckHeap()
1344 OSi_CHECK(cell->hd == NULL); in OS_CheckHeap()
1348 OSi_CHECK(total == hd->size); in OS_CheckHeap()
1393 SDK_TASSERTMSG(cell->hd, OS_ERR_REFERENT_INVPTR); in OS_ReferentSize()
1394 …SDK_TASSERTMSG(((char *)cell->hd - (char *)heapInfo->heapArray) % sizeof(HeapDesc) == 0, OS_ERR_RE… in OS_ReferentSize()
1395 …SDK_TASSERTMSG(heapInfo->heapArray <= cell->hd && cell->hd < &heapInfo->heapArray[heapInfo->numHea… in OS_ReferentSize()
1396 SDK_TASSERTMSG(0 <= cell->hd->size, OS_ERR_REFERENT_INVPTR); in OS_ReferentSize()
1397 SDK_TASSERTMSG(DLLookup(cell->hd->allocated, cell), OS_ERR_REFERENT_INVPTR); in OS_ReferentSize()
1417 HeapDesc *hd; in OS_DumpHeap() local
1435 hd = &heapInfo->heapArray[heap]; in OS_DumpHeap()
1436 if (hd->size < 0) in OS_DumpHeap()
1447 hd->paddingBytes, 100.0 * hd->paddingBytes / hd->size, in OS_DumpHeap()
1448 hd->headerBytes, 100.0 * hd->headerBytes / hd->size, in OS_DumpHeap()
1449 hd->payloadBytes, 100.0 * hd->payloadBytes / hd->size); in OS_DumpHeap()
1456 … SDK_TASSERTMSG(hd->allocated == NULL || hd->allocated->prev == NULL, OS_ERR_DUMPHEAP_BROKENHEAP); in OS_DumpHeap()
1457 if ( ! hd->allocated ) in OS_DumpHeap()
1463 for (cell = hd->allocated; cell; cell = cell->next) in OS_DumpHeap()
1471 if ( ! hd->free ) in OS_DumpHeap()
1477 for (cell = hd->free; cell; cell = cell->next) in OS_DumpHeap()
1683 HeapDesc *hd; in OS_ClearHeap() local
1717 hd = &heapInfo->heapArray[heap]; in OS_ClearHeap()
1718 hd->size = (char *)end - (char *)start; in OS_ClearHeap()
1723 cell->size = hd->size; in OS_ClearHeap()
1725 cell->hd = NULL; in OS_ClearHeap()
1728 hd->free = cell; in OS_ClearHeap()
1729 hd->allocated = 0; in OS_ClearHeap()
1731 hd->paddingBytes = hd->headerBytes = hd->payloadBytes = 0; in OS_ClearHeap()