Changeset 31158 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 28, 2010 3:24:30 AM (14 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/darwin/alloc-darwin.cpp
r31157 r31158 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Memory Allocation, POSIX.3 * IPRT - Memory Allocation, Darwin. 4 4 */ 5 5 … … 152 152 return RTErrConvertFromErrno(errno); 153 153 } 154 -
trunk/src/VBox/Runtime/r3/freebsd/alloc-freebsd.cpp
r28800 r31158 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Memory Allocation, POSIX.3 * IPRT - Memory Allocation, FreeBSD. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 40 40 41 41 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 42 RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 50 43 { 51 44 /* … … 73 66 74 67 75 /**76 * Free executable/read/write memory allocated by RTMemExecAlloc().77 *78 * @param pv Pointer to memory block.79 */80 68 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 81 69 { … … 85 73 86 74 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 75 RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 95 76 { 96 77 cb = RT_ALIGN_Z(cb, PAGE_SIZE); … … 103 84 104 85 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 86 RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW 113 87 { 114 88 cb = RT_ALIGN_Z(cb, PAGE_SIZE); … … 120 94 121 95 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 */128 96 RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW 129 97 { … … 133 101 134 102 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 */143 103 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 144 104 { … … 196 156 return RTErrConvertFromErrno(errno); 197 157 } 158 -
trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp
r28800 r31158 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 80 80 81 81 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 82 RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 90 83 { 91 84 AssertMsg(cb, ("Allocating ZERO bytes is really not a good idea! Good luck with the next assertion!\n")); … … 140 133 141 134 142 /**143 * Free executable/read/write memory allocated by RTMemExecAlloc().144 *145 * @param pv Pointer to memory block.146 */147 135 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 148 136 { … … 162 150 163 151 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 152 RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 172 153 { 173 154 #ifdef RT_USE_MMAP_PAGE … … 191 172 192 173 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 174 RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW 201 175 { 202 176 #ifdef RT_USE_MMAP_PAGE … … 219 193 220 194 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 */227 195 RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW 228 196 { … … 242 210 243 211 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 */252 212 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 253 213 { -
trunk/src/VBox/Runtime/r3/solaris/alloc-solaris.cpp
r29277 r31158 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Memory Allocation, POSIX.3 * IPRT - Memory Allocation, Solaris. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 49 49 50 50 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 51 RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 59 52 { 60 53 /* … … 89 82 90 83 91 /**92 * Free executable/read/write memory allocated by RTMemExecAlloc().93 *94 * @param pv Pointer to memory block.95 */96 84 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 97 85 { … … 101 89 102 90 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 91 RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 111 92 { 112 93 #ifdef RT_USE_MMAP_PAGE … … 122 103 123 104 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 105 RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW 132 106 { 133 107 #ifdef RT_USE_MMAP_PAGE … … 147 121 148 122 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 */155 123 RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW 156 124 { … … 168 136 169 137 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 */178 138 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 179 139 { -
trunk/src/VBox/Runtime/r3/win/alloc-win.cpp
r28800 r31158 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Memory Allocation, Win 32.3 * IPRT - Memory Allocation, Windows. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 43 43 44 44 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 45 RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 53 46 { 54 47 /* … … 83 76 84 77 85 /**86 * Free executable/read/write memory allocated by RTMemExecAlloc().87 *88 * @param pv Pointer to memory block.89 */90 78 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 91 79 { … … 95 83 96 84 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 85 RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW 105 86 { 106 87 #ifdef USE_VIRTUAL_ALLOC … … 114 95 115 96 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 97 RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW 124 98 { 125 99 #ifdef USE_VIRTUAL_ALLOC … … 138 112 139 113 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 */146 114 RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW 147 115 { … … 158 126 159 127 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 */168 128 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 169 129 {
Note:
See TracChangeset
for help on using the changeset viewer.