Changeset 11020 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 30, 2008 10:48:35 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/freebsd/alloc-freebsd.cpp
r8245 r11020 51 51 * @param cb Size in bytes of the memory block to allocate. 52 52 */ 53 RTDECL(void *) RTMemExecAlloc(size_t cb) 53 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW 54 54 { 55 55 /* … … 82 82 * @param pv Pointer to memory block. 83 83 */ 84 RTDECL(void) RTMemExecFree(void *pv) 84 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 85 85 { 86 86 return RTMemPageFree(pv); … … 95 95 * @param cb Size of the memory block. Will be rounded up to page size. 96 96 */ 97 RTDECL(void *) RTMemPageAlloc(size_t cb) 97 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW 98 98 { 99 99 cb = RT_ALIGN_Z(cb, PAGE_SIZE); … … 113 113 * @param cb Size of the memory block. Will be rounded up to page size. 114 114 */ 115 RTDECL(void *) RTMemPageAllocZ(size_t cb) 115 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW 116 116 { 117 117 cb = RT_ALIGN_Z(cb, PAGE_SIZE); … … 129 129 * NULL will be ignored. 130 130 */ 131 RTDECL(void) RTMemPageFree(void *pv) 131 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW 132 132 { 133 133 if (pv) … … 144 144 * @param fProtect The new protection, a combination of the RTMEM_PROT_* defines. 145 145 */ 146 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) 146 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 147 147 { 148 148 /* -
trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp
r8245 r11020 46 46 #if !defined(RT_USE_MMAP) && (defined(RT_OS_LINUX)) 47 47 # define RT_USE_MMAP 48 #endif 48 #endif 49 49 50 50 /******************************************************************************* … … 52 52 *******************************************************************************/ 53 53 #ifdef RT_USE_MMAP 54 /** 54 /** 55 55 * RTMemExecAlloc() header used when using mmap for allocating the memory. 56 56 */ … … 63 63 # if ARCH_BITS == 32 64 64 uint32_t Alignment[2]; 65 # endif 65 # endif 66 66 } RTMEMEXECHDR, *PRTMEMEXECHDR; 67 67 … … 82 82 * @param cb Size in bytes of the memory block to allocate. 83 83 */ 84 RTDECL(void *) RTMemExecAlloc(size_t cb) 84 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW 85 85 { 86 86 AssertMsg(cb, ("Allocating ZERO bytes is really not a good idea! Good luck with the next assertion!\n")); … … 91 91 */ 92 92 size_t cbAlloc = RT_ALIGN_Z(cb + sizeof(RTMEMEXECHDR), PAGE_SIZE); 93 void *pv = mmap(NULL, cbAlloc, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS 93 void *pv = mmap(NULL, cbAlloc, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS 94 94 #if defined(RT_ARCH_AMD64) && defined(MAP_32BIT) 95 95 | MAP_32BIT … … 140 140 * @param pv Pointer to memory block. 141 141 */ 142 RTDECL(void) RTMemExecFree(void *pv) 142 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 143 143 { 144 144 if (pv) … … 152 152 #else 153 153 free(pv); 154 #endif 154 #endif 155 155 } 156 156 } … … 164 164 * @param cb Size of the memory block. Will be rounded up to page size. 165 165 */ 166 RTDECL(void *) RTMemPageAlloc(size_t cb) 166 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW 167 167 { 168 168 #if 0 /** @todo huh? we're using posix_memalign in the next function... */ … … 185 185 * @param cb Size of the memory block. Will be rounded up to page size. 186 186 */ 187 RTDECL(void *) RTMemPageAllocZ(size_t cb) 187 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW 188 188 { 189 189 void *pv; … … 204 204 * NULL will be ignored. 205 205 */ 206 RTDECL(void) RTMemPageFree(void *pv) 206 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW 207 207 { 208 208 if (pv) … … 219 219 * @param fProtect The new protection, a combination of the RTMEM_PROT_* defines. 220 220 */ 221 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) 221 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 222 222 { 223 223 /* -
trunk/src/VBox/Runtime/r3/solaris/alloc-solaris.cpp
r8245 r11020 54 54 * @param cb Size in bytes of the memory block to allocate. 55 55 */ 56 RTDECL(void *) RTMemExecAlloc(size_t cb) 56 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW 57 57 { 58 58 /* … … 92 92 * @param pv Pointer to memory block. 93 93 */ 94 RTDECL(void) RTMemExecFree(void *pv) 94 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 95 95 { 96 96 if (pv) … … 106 106 * @param cb Size of the memory block. Will be rounded up to page size. 107 107 */ 108 RTDECL(void *) RTMemPageAlloc(size_t cb) 108 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW 109 109 { 110 110 return valloc(RT_ALIGN_Z(cb, PAGE_SIZE)); … … 119 119 * @param cb Size of the memory block. Will be rounded up to page size. 120 120 */ 121 RTDECL(void *) RTMemPageAllocZ(size_t cb) 121 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW 122 122 { 123 123 cb = RT_ALIGN_Z(cb, PAGE_SIZE); … … 135 135 * NULL will be ignored. 136 136 */ 137 RTDECL(void) RTMemPageFree(void *pv) 137 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW 138 138 { 139 139 if (pv) … … 150 150 * @param fProtect The new protection, a combination of the RTMEM_PROT_* defines. 151 151 */ 152 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) 152 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 153 153 { 154 154 /* -
trunk/src/VBox/Runtime/r3/win/alloc-win.cpp
r8245 r11020 54 54 * @param cb Size in bytes of the memory block to allocate. 55 55 */ 56 RTDECL(void *) RTMemExecAlloc(size_t cb) 56 RTDECL(void *) RTMemExecAlloc(size_t cb) RT_NO_THROW 57 57 { 58 58 /* … … 92 92 * @param pv Pointer to memory block. 93 93 */ 94 RTDECL(void) RTMemExecFree(void *pv) 94 RTDECL(void) RTMemExecFree(void *pv) RT_NO_THROW 95 95 { 96 96 if (pv) … … 106 106 * @param cb Size of the memory block. Will be rounded up to page size. 107 107 */ 108 RTDECL(void *) RTMemPageAlloc(size_t cb) 108 RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW 109 109 { 110 110 #ifdef USE_VIRTUAL_ALLOC … … 125 125 * @param cb Size of the memory block. Will be rounded up to page size. 126 126 */ 127 RTDECL(void *) RTMemPageAllocZ(size_t cb) 127 RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW 128 128 { 129 129 #ifdef USE_VIRTUAL_ALLOC … … 148 148 * NULL will be ignored. 149 149 */ 150 RTDECL(void) RTMemPageFree(void *pv) 150 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW 151 151 { 152 152 if (pv) … … 170 170 * @param fProtect The new protection, a combination of the RTMEM_PROT_* defines. 171 171 */ 172 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) 172 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW 173 173 { 174 174 /*
Note:
See TracChangeset
for help on using the changeset viewer.