Changeset 11020 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Jul 30, 2008 10:48:35 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 /*
Note:
See TracChangeset
for help on using the changeset viewer.