VirtualBox

Changeset 97929 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Dec 31, 2022 1:31:41 AM (2 years ago)
Author:
vboxsync
Message:

Add/VBoxGuestR0LibPhysHeap.cpp: Removed unused inline function offending clang.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibPhysHeap.cpp

    r97928 r97929  
    8585
    8686/* Heap block signature */
    87 #define VBGL_PH_BLOCKSIGNATURE  UINT32_C(0xADDBBBBB)
     87#define VBGL_PH_BLOCKSIGNATURE          UINT32_C(0xADDBBBBB)
    8888
    8989/* Heap chunk signature */
    90 #define VBGL_PH_CHUNKSIGNATURE  UINT32_C(0xADDCCCCC)
     90#define VBGL_PH_CHUNKSIGNATURE          UINT32_C(0xADDCCCCC)
    9191/* Heap chunk allocation unit */
    92 #define VBGL_PH_CHUNKSIZE       (0x10000)
     92#define VBGL_PH_CHUNKSIZE               (0x10000)
     93
     94/** The allocation block alignment.
     95 *
     96 * This is also the the minimum block size.
     97 */
     98#define VBGL_PH_ALLOC_ALIGN             (sizeof(void *))
    9399
    94100/** Max number of free nodes to search before just using the best fit.
     
    244250
    245251
    246 DECLINLINE(void) vbglPhysHeapLeave(void)
    247 {
    248     RTSemFastMutexRelease(g_vbgldata.mutexHeap);
    249 }
    250 
    251 
    252252static void vbglPhysHeapInitFreeBlock(VBGLPHYSHEAPBLOCK *pBlock, VBGLPHYSHEAPCHUNK *pChunk, uint32_t cbDataSize)
    253253{
     
    316316    pBlock->pChunk->acBlocks[fAllocated] += 1;
    317317    AssertMsg(   (uint32_t)pBlock->pChunk->acBlocks[fAllocated]
    318               <= pBlock->pChunk->cbSize / (sizeof(*pBlock) + sizeof(void *)),
     318              <= pBlock->pChunk->cbSize / (sizeof(*pBlock) + VBGL_PH_ALLOC_ALIGN),
    319319              ("pChunk=%p: cbSize=%#x acBlocks[%u]=%d\n",
    320320               pBlock->pChunk, pBlock->pChunk->cbSize, fAllocated, pBlock->pChunk->acBlocks[fAllocated]));
     
    514514     * Align the size to a pointer size to avoid getting misaligned header pointers and whatnot.
    515515     */
    516     cbSize = RT_ALIGN_32(cbSize, sizeof(void *));
    517     AssertStmt(cbSize > 0, cbSize = sizeof(void *)); /* avoid allocating zero bytes */
     516    cbSize = RT_ALIGN_32(cbSize, VBGL_PH_ALLOC_ALIGN);
     517    AssertStmt(cbSize > 0, cbSize = VBGL_PH_ALLOC_ALIGN); /* avoid allocating zero bytes */
    518518
    519519    rc = RTSemFastMutexRequest(g_vbgldata.mutexHeap);
     
    876876                         RTErrInfoSetF(pErrInfo, VERR_INTERNAL_ERROR_2,
    877877                                       "pCurBlock=%p: pChunk=%p, expected %p", pCurBlock, pCurBlock->pChunk, pCurChunk));
    878             AssertReturn(   pCurBlock->cbDataSize >= sizeof(void *)
     878            AssertReturn(   pCurBlock->cbDataSize >= VBGL_PH_ALLOC_ALIGN
    879879                         && pCurBlock->cbDataSize < _128M
    880                          && RT_ALIGN_32(pCurBlock->cbDataSize, sizeof(void *)) == pCurBlock->cbDataSize,
     880                         && RT_ALIGN_32(pCurBlock->cbDataSize, VBGL_PH_ALLOC_ALIGN) == pCurBlock->cbDataSize,
    881881                         RTErrInfoSetF(pErrInfo, VERR_INTERNAL_ERROR_3,
    882882                                       "pCurBlock=%p: cbDataSize=%#x", pCurBlock, pCurBlock->cbDataSize));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette