VirtualBox

Changeset 97907 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Dec 29, 2022 6:33:45 PM (2 years ago)
Author:
vboxsync
Message:

IPRT: Removed the RTMemExecAlloc interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/alloc-r0drv.cpp

    r96407 r97907  
    322322}
    323323RT_EXPORT_SYMBOL(RTMemFreeZ);
    324 
    325 
    326 
    327 
    328 
    329 
    330 RTDECL(void *)    RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
    331 {
    332     PRTMEMHDR pHdr;
    333 #ifdef RT_OS_SOLARIS /** @todo figure out why */
    334     RT_ASSERT_INTS_ON();
    335 #else
    336     RT_ASSERT_PREEMPTIBLE();
    337 #endif
    338     RT_NOREF_PV(pszTag);
    339 
    340 
    341     pHdr = rtR0MemAlloc(cb + RTR0MEM_FENCE_EXTRA, RTMEMHDR_FLAG_EXEC);
    342     if (pHdr)
    343     {
    344 #ifdef RTR0MEM_STRICT
    345         pHdr->cbReq = (uint32_t)cb; Assert(pHdr->cbReq == cb);
    346         memcpy((uint8_t *)(pHdr + 1) + cb, &g_abFence[0], RTR0MEM_FENCE_EXTRA);
    347 #endif
    348         return pHdr + 1;
    349     }
    350     return NULL;
    351 }
    352 RT_EXPORT_SYMBOL(RTMemExecAllocTag);
    353 
    354 
    355 RTDECL(void)      RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_DEF
    356 {
    357     PRTMEMHDR pHdr;
    358     RT_ASSERT_INTS_ON();
    359     RT_NOREF_PV(cb);
    360 
    361     if (!pv)
    362         return;
    363     pHdr = (PRTMEMHDR)pv - 1;
    364     if (pHdr->u32Magic == RTMEMHDR_MAGIC)
    365     {
    366         Assert(!(pHdr->fFlags & RTMEMHDR_FLAG_ALLOC_EX));
    367 #ifdef RTR0MEM_STRICT
    368         AssertReleaseMsg(!memcmp((uint8_t *)(pHdr + 1) + pHdr->cbReq, &g_abFence[0], RTR0MEM_FENCE_EXTRA),
    369                          ("pHdr=%p pv=%p cbReq=%u cb=%u fFlags=%#x\n"
    370                           "fence:    %.*Rhxs\n"
    371                           "expected: %.*Rhxs\n",
    372                           pHdr, pv, pHdr->cbReq, pHdr->cb, pHdr->fFlags,
    373                           RTR0MEM_FENCE_EXTRA, (uint8_t *)(pHdr + 1) + pHdr->cbReq,
    374                           RTR0MEM_FENCE_EXTRA, &g_abFence[0]));
    375 #endif
    376         rtR0MemFree(pHdr);
    377     }
    378     else
    379         AssertMsgFailed(("pHdr->u32Magic=%RX32 pv=%p\n", pHdr->u32Magic, pv));
    380 }
    381 RT_EXPORT_SYMBOL(RTMemExecFree);
    382 
    383 
    384324
    385325
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