VirtualBox

Changeset 83368 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Mar 23, 2020 1:52:14 PM (5 years ago)
Author:
vboxsync
Message:

IPRT: Added RTMemAllocZ and RTMemEfReallocZ[NP].

File:
1 edited

Legend:

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

    r82968 r83368  
    884884
    885885
     886RTDECL(void *)  RTMemEfReallocZ(void *pvOld, size_t cbOld, size_t cbNew, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
     887{
     888    void *pvDst = rtR3MemRealloc("ReallocZ", RTMEMTYPE_RTMEMREALLOC, pvOld, cbNew, pszTag, ASMReturnAddress(), RT_SRC_POS_ARGS);
     889    if (pvDst && cbNew > cbOld)
     890        memset((uint8_t *)pvDst + cbOld, 0, cbNew - cbOld);
     891    return pvDst;
     892}
     893
     894
    886895RTDECL(void)    RTMemEfFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW_DEF
    887896{
     
    981990
    982991
     992RTDECL(void *)  RTMemEfReallocZNP(void *pvOld, size_t cbOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
     993{
     994    void *pvDst = rtR3MemRealloc("ReallocZ", RTMEMTYPE_RTMEMREALLOC, pvOld, cbNew, pszTag, ASMReturnAddress(), NULL, 0, NULL);
     995    if (pvDst && cbNew > cbOld)
     996        memset((uint8_t *)pvDst + cbOld, 0, cbNew - cbOld);
     997    return pvDst;
     998}
     999
     1000
    9831001RTDECL(void)    RTMemEfFreeNP(void *pv) RT_NO_THROW_DEF
    9841002{
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