VirtualBox

Changeset 31157 in vbox for trunk/src/VBox/Runtime/r3/darwin


Ignore:
Timestamp:
Jul 28, 2010 3:15:35 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64135
Message:

iprt,++: Tag allocation in all builds with a string, defaulting to FILE.

File:
1 edited

Legend:

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

    r28800 r31157  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4040
    4141
    42 /**
    43  * Allocates memory which may contain code.
    44  *
    45  * @returns Pointer to the allocated memory.
    46  * @returns NULL on failure.
    47  * @param   cb      Size in bytes of the memory block to allocate.
    48  */
    49 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW
     42RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    5043{
    5144    /*
     
    7467
    7568
    76 /**
    77  * Free executable/read/write memory allocated by RTMemExecAlloc().
    78  *
    79  * @param   pv      Pointer to memory block.
    80  */
    8169RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW
    8270{
     
    8674
    8775
    88 /**
    89  * Allocate page aligned memory.
    90  *
    91  * @returns Pointer to the allocated memory.
    92  * @returns NULL if we're out of memory.
    93  * @param   cb  Size of the memory block. Will be rounded up to page size.
    94  */
    95 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW
     76RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    9677{
    9778    return valloc(RT_ALIGN_Z(cb, PAGE_SIZE));
     
    9980
    10081
    101 /**
    102  * Allocate zero'ed page aligned memory.
    103  *
    104  * @returns Pointer to the allocated memory.
    105  * @returns NULL if we're out of memory.
    106  * @param   cb  Size of the memory block. Will be rounded up to page size.
    107  */
    108 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW
     82RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
    10983{
    11084    cb = RT_ALIGN_Z(cb, PAGE_SIZE);
     
    11690
    11791
    118 /**
    119  * Free a memory block allocated with RTMemPageAlloc() or RTMemPageAllocZ().
    120  *
    121  * @param   pv      Pointer to the block as it was returned by the allocation function.
    122  *                  NULL will be ignored.
    123  */
    12492RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    12593{
     
    12997
    13098
    131 /**
    132  * Change the page level protection of a memory region.
    133  *
    134  * @returns iprt status code.
    135  * @param   pv          Start of the region. Will be rounded down to nearest page boundary.
    136  * @param   cb          Size of the region. Will be rounded up to the nearest page boundary.
    137  * @param   fProtect    The new protection, a combination of the RTMEM_PROT_* defines.
    138  */
    13999RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
    140100{
Note: See TracChangeset for help on using the changeset viewer.

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