VirtualBox

Changeset 31158 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jul 28, 2010 3:24:30 AM (14 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Runtime/r3
Files:
5 edited

Legend:

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

    r31157 r31158  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Memory Allocation, POSIX.
     3 * IPRT - Memory Allocation, Darwin.
    44 */
    55
     
    152152    return RTErrConvertFromErrno(errno);
    153153}
     154
  • trunk/src/VBox/Runtime/r3/freebsd/alloc-freebsd.cpp

    r28800 r31158  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Memory Allocation, POSIX.
     3 * IPRT - Memory Allocation, FreeBSD.
    44 */
    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    /*
     
    7366
    7467
    75 /**
    76  * Free executable/read/write memory allocated by RTMemExecAlloc().
    77  *
    78  * @param   pv      Pointer to memory block.
    79  */
    8068RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW
    8169{
     
    8573
    8674
    87 /**
    88  * Allocate page aligned memory.
    89  *
    90  * @returns Pointer to the allocated memory.
    91  * @returns NULL if we're out of memory.
    92  * @param   cb  Size of the memory block. Will be rounded up to page size.
    93  */
    94 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW
     75RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    9576{
    9677    cb = RT_ALIGN_Z(cb, PAGE_SIZE);
     
    10384
    10485
    105 /**
    106  * Allocate zero'ed page aligned memory.
    107  *
    108  * @returns Pointer to the allocated memory.
    109  * @returns NULL if we're out of memory.
    110  * @param   cb  Size of the memory block. Will be rounded up to page size.
    111  */
    112 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW
     86RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
    11387{
    11488    cb = RT_ALIGN_Z(cb, PAGE_SIZE);
     
    12094
    12195
    122 /**
    123  * Free a memory block allocated with RTMemPageAlloc() or RTMemPageAllocZ().
    124  *
    125  * @param   pv      Pointer to the block as it was returned by the allocation function.
    126  *                  NULL will be ignored.
    127  */
    12896RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    12997{
     
    133101
    134102
    135 /**
    136  * Change the page level protection of a memory region.
    137  *
    138  * @returns iprt status code.
    139  * @param   pv          Start of the region. Will be rounded down to nearest page boundary.
    140  * @param   cb          Size of the region. Will be rounded up to the nearest page boundary.
    141  * @param   fProtect    The new protection, a combination of the RTMEM_PROT_* defines.
    142  */
    143103RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
    144104{
     
    196156    return RTErrConvertFromErrno(errno);
    197157}
     158
  • trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp

    r28800 r31158  
    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
     
    8080
    8181
    82 /**
    83  * Allocates memory which may contain code.
    84  *
    85  * @returns Pointer to the allocated memory.
    86  * @returns NULL on failure.
    87  * @param   cb      Size in bytes of the memory block to allocate.
    88  */
    89 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW
     82RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    9083{
    9184    AssertMsg(cb, ("Allocating ZERO bytes is really not a good idea! Good luck with the next assertion!\n"));
     
    140133
    141134
    142 /**
    143  * Free executable/read/write memory allocated by RTMemExecAlloc().
    144  *
    145  * @param   pv      Pointer to memory block.
    146  */
    147135RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW
    148136{
     
    162150
    163151
    164 /**
    165  * Allocate page aligned memory.
    166  *
    167  * @returns Pointer to the allocated memory.
    168  * @returns NULL if we're out of memory.
    169  * @param   cb  Size of the memory block. Will be rounded up to page size.
    170  */
    171 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW
     152RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    172153{
    173154#ifdef RT_USE_MMAP_PAGE
     
    191172
    192173
    193 /**
    194  * Allocate zero'ed page aligned memory.
    195  *
    196  * @returns Pointer to the allocated memory.
    197  * @returns NULL if we're out of memory.
    198  * @param   cb  Size of the memory block. Will be rounded up to page size.
    199  */
    200 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW
     174RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
    201175{
    202176#ifdef RT_USE_MMAP_PAGE
     
    219193
    220194
    221 /**
    222  * Free a memory block allocated with RTMemPageAlloc() or RTMemPageAllocZ().
    223  *
    224  * @param   pv      Pointer to the block as it was returned by the allocation function.
    225  *                  NULL will be ignored.
    226  */
    227195RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    228196{
     
    242210
    243211
    244 /**
    245  * Change the page level protection of a memory region.
    246  *
    247  * @returns iprt status code.
    248  * @param   pv          Start of the region. Will be rounded down to nearest page boundary.
    249  * @param   cb          Size of the region. Will be rounded up to the nearest page boundary.
    250  * @param   fProtect    The new protection, a combination of the RTMEM_PROT_* defines.
    251  */
    252212RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
    253213{
  • trunk/src/VBox/Runtime/r3/solaris/alloc-solaris.cpp

    r29277 r31158  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Memory Allocation, POSIX.
     3 * IPRT - Memory Allocation, Solaris.
    44 */
    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
     
    4949
    5050
    51 /**
    52  * Allocates memory which may contain code.
    53  *
    54  * @returns Pointer to the allocated memory.
    55  * @returns NULL on failure.
    56  * @param   cb      Size in bytes of the memory block to allocate.
    57  */
    58 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW
     51RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    5952{
    6053    /*
     
    8982
    9083
    91 /**
    92  * Free executable/read/write memory allocated by RTMemExecAlloc().
    93  *
    94  * @param   pv      Pointer to memory block.
    95  */
    9684RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW
    9785{
     
    10189
    10290
    103 /**
    104  * Allocate page aligned memory.
    105  *
    106  * @returns Pointer to the allocated memory.
    107  * @returns NULL if we're out of memory.
    108  * @param   cb  Size of the memory block. Will be rounded up to page size.
    109  */
    110 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW
     91RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    11192{
    11293#ifdef RT_USE_MMAP_PAGE
     
    122103
    123104
    124 /**
    125  * Allocate zero'ed page aligned memory.
    126  *
    127  * @returns Pointer to the allocated memory.
    128  * @returns NULL if we're out of memory.
    129  * @param   cb  Size of the memory block. Will be rounded up to page size.
    130  */
    131 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW
     105RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
    132106{
    133107#ifdef RT_USE_MMAP_PAGE
     
    147121
    148122
    149 /**
    150  * Free a memory block allocated with RTMemPageAlloc() or RTMemPageAllocZ().
    151  *
    152  * @param   pv      Pointer to the block as it was returned by the allocation function.
    153  *                  NULL will be ignored.
    154  */
    155123RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    156124{
     
    168136
    169137
    170 /**
    171  * Change the page level protection of a memory region.
    172  *
    173  * @returns iprt status code.
    174  * @param   pv          Start of the region. Will be rounded down to nearest page boundary.
    175  * @param   cb          Size of the region. Will be rounded up to the nearest page boundary.
    176  * @param   fProtect    The new protection, a combination of the RTMEM_PROT_* defines.
    177  */
    178138RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
    179139{
  • trunk/src/VBox/Runtime/r3/win/alloc-win.cpp

    r28800 r31158  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Memory Allocation, Win32.
     3 * IPRT - Memory Allocation, Windows.
    44 */
    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
     
    4343
    4444
    45 /**
    46  * Allocates memory which may contain code.
    47  *
    48  * @returns Pointer to the allocated memory.
    49  * @returns NULL on failure.
    50  * @param   cb      Size in bytes of the memory block to allocate.
    51  */
    52 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW
     45RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    5346{
    5447    /*
     
    8376
    8477
    85 /**
    86  * Free executable/read/write memory allocated by RTMemExecAlloc().
    87  *
    88  * @param   pv      Pointer to memory block.
    89  */
    9078RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW
    9179{
     
    9583
    9684
    97 /**
    98  * Allocate page aligned memory.
    99  *
    100  * @returns Pointer to the allocated memory.
    101  * @returns NULL if we're out of memory.
    102  * @param   cb  Size of the memory block. Will be rounded up to page size.
    103  */
    104 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW
     85RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
    10586{
    10687#ifdef USE_VIRTUAL_ALLOC
     
    11495
    11596
    116 /**
    117  * Allocate zero'ed page aligned memory.
    118  *
    119  * @returns Pointer to the allocated memory.
    120  * @returns NULL if we're out of memory.
    121  * @param   cb  Size of the memory block. Will be rounded up to page size.
    122  */
    123 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW
     97RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
    12498{
    12599#ifdef USE_VIRTUAL_ALLOC
     
    138112
    139113
    140 /**
    141  * Free a memory block allocated with RTMemPageAlloc() or RTMemPageAllocZ().
    142  *
    143  * @param   pv      Pointer to the block as it was returned by the allocation function.
    144  *                  NULL will be ignored.
    145  */
    146114RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    147115{
     
    158126
    159127
    160 /**
    161  * Change the page level protection of a memory region.
    162  *
    163  * @returns iprt status code.
    164  * @param   pv          Start of the region. Will be rounded down to nearest page boundary.
    165  * @param   cb          Size of the region. Will be rounded up to the nearest page boundary.
    166  * @param   fProtect    The new protection, a combination of the RTMEM_PROT_* defines.
    167  */
    168128RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
    169129{
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