VirtualBox

Changeset 46567 in vbox for trunk


Ignore:
Timestamp:
Jun 14, 2013 4:12:24 PM (12 years ago)
Author:
vboxsync
Message:

RTMemAllocEx for ring-3.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r46298 r46567  
    812812# define RTMd5ToString                                  RT_MANGLER(RTMd5ToString)
    813813# define RTMd5Update                                    RT_MANGLER(RTMd5Update)
    814 # define RTMemAllocExTag                                RT_MANGLER(RTMemAllocExTag) /* r0drv */
     814# define RTMemAllocExTag                                RT_MANGLER(RTMemAllocExTag)
    815815# define RTMemAllocTag                                  RT_MANGLER(RTMemAllocTag)
    816816# define RTMemAllocVarTag                               RT_MANGLER(RTMemAllocVarTag)
     
    852852# define RTMemExecFree                                  RT_MANGLER(RTMemExecFree)
    853853# define RTMemFree                                      RT_MANGLER(RTMemFree)
    854 # define RTMemFreeEx                                    RT_MANGLER(RTMemFreeEx)     /* r0drv */
     854# define RTMemFreeEx                                    RT_MANGLER(RTMemFreeEx)
    855855# define RTMemPageAllocTag                              RT_MANGLER(RTMemPageAllocTag)
    856856# define RTMemPageAllocZTag                             RT_MANGLER(RTMemPageAllocZTag)
  • trunk/include/iprt/mem.h

    r45174 r46567  
    314314 * Will return VERR_NOT_SUPPORTED if not supported. */
    315315#define RTMEMALLOCEX_FLAGS_ANY_CTX          (RTMEMALLOCEX_FLAGS_ANY_CTX_ALLOC | RTMEMALLOCEX_FLAGS_ANY_CTX_FREE)
     316/** Reachable by 16-bit address.
     317 * Will return VERR_NOT_SUPPORTED if not supported.  */
     318#define RTMEMALLOCEX_FLAGS_16BIT_REACH      RT_BIT(4)
     319/** Reachable by 32-bit address.
     320 * Will return VERR_NOT_SUPPORTED if not supported.  */
     321#define RTMEMALLOCEX_FLAGS_32BIT_REACH      RT_BIT(5)
    316322/** Mask of valid flags. */
    317 #define RTMEMALLOCEX_FLAGS_VALID_MASK       UINT32_C(0x0000000f)
     323#define RTMEMALLOCEX_FLAGS_VALID_MASK       UINT32_C(0x0000003f)
     324/** Mask of valid flags for ring-0. */
     325#define RTMEMALLOCEX_FLAGS_VALID_MASK_R0    UINT32_C(0x0000000f)
    318326/** @}  */
    319327
     
    337345/**
    338346 * Extended heap allocation API, custom tag.
     347 *
     348 * Depending on the implementation, using this function may add extra overhead,
     349 * so use the simpler APIs where ever possible.
    339350 *
    340351 * @returns IPRT status code.
     
    358369 * @param   pv                  What to free, NULL is fine.
    359370 * @param   cb                  The amount of allocated memory.
     371 * @param   fFlags              The flags specified when allocating the memory.
     372 *                              Whether the exact flags are requires depends on
     373 *                              the implementation, but in general, ring-0
     374 *                              doesn't require anything while ring-3 requires
     375 *                              RTMEMALLOCEX_FLAGS_EXEC if used.
    360376 */
    361377RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW;
  • trunk/src/VBox/Runtime/Makefile.kmk

    r46266 r46567  
    583583        generic/RTThreadGetNativeState-generic.cpp \
    584584        nt/RTErrConvertFromNtStatus.cpp \
     585        r3/generic/allocex-r3-generic.cpp \
    585586        r3/posix/env-posix.cpp \
    586587        r3/win/RTHandleGetStandard-win.cpp \
     
    638639        generic/utf16locale-generic.cpp \
    639640        generic/uuid-generic.cpp \
     641        r3/generic/allocex-r3-generic.cpp \
    640642        r3/linux/RTThreadGetNativeState-linux.cpp \
    641643        r3/linux/mp-linux.cpp \
     
    735737        generic/RTThreadGetNativeState-generic.cpp \
    736738        os2/RTErrConvertFromOS2.cpp \
     739        r3/generic/allocex-r3-generic.cpp \
    737740        r3/os2/filelock-os2.cpp \
    738741        r3/os2/mp-os2.cpp \
     
    808811        r3/darwin/time-darwin.cpp \
    809812        r3/darwin/RTPathUserDocuments-darwin.cpp \
     813        r3/generic/allocex-r3-generic.cpp \
    810814        r3/posix/RTFileQueryFsSizes-posix.cpp \
    811815        r3/posix/RTHandleGetStandard-posix.cpp \
     
    868872        r3/freebsd/mp-freebsd.cpp \
    869873        r3/freebsd/rtProcInitExePath-freebsd.cpp \
     874        r3/generic/allocex-r3-generic.cpp \
    870875        r3/posix/RTFileQueryFsSizes-posix.cpp \
    871876        r3/posix/RTHandleGetStandard-posix.cpp \
     
    928933        generic/uuid-generic.cpp \
    929934        generic/RTThreadGetNativeState-generic.cpp \
     935        r3/generic/allocex-r3-generic.cpp \
    930936        r3/posix/RTFileQueryFsSizes-posix.cpp \
    931937        r3/posix/RTHandleGetStandard-posix.cpp \
     
    10031009        r3/haiku/rtProcInitExePath-haiku.cpp \
    10041010        r3/haiku/time-haiku.cpp \
     1011        r3/generic/allocex-r3-generic.cpp \
    10051012        r3/posix/RTFileQueryFsSizes-posix.cpp \
    10061013        r3/posix/RTHandleGetStandard-posix.cpp \
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r45984 r46567  
    115115/** The magic value for heap blocks. (Edgar Allan Poe) */
    116116#define RTMEMHDR_MAGIC                  UINT32_C(0x18090119)
     117/** The magic value for heap blocks after freeing. */
     118#define RTMEMHDR_MAGIC_DEAD             UINT32_C(0x18491007)
    117119/** The value of RTPIPEINTERNAL::u32Magic. (Frank Schaetzing) */
    118120#define RTPIPE_MAGIC                    UINT32_C(0x19570528)
  • trunk/src/VBox/Runtime/r0drv/alloc-r0drv.cpp

    r46565 r46567  
    350350     * Validate and convert flags.
    351351     */
    352     AssertMsgReturn(!(fFlags & ~RTMEMALLOCEX_FLAGS_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
     352    AssertMsgReturn(!(fFlags & ~RTMEMALLOCEX_FLAGS_VALID_MASK_R0), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    353353    if (fFlags & RTMEMALLOCEX_FLAGS_ZEROED)
    354354        fHdrFlags |= RTMEMHDR_FLAG_ZEROED;
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