Changeset 97904 in vbox
- Timestamp:
- Dec 29, 2022 6:14:03 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/allocex.cpp
r96407 r97904 92 92 else if (fFlags & RTMEMALLOCEX_FLAGS_EXEC) 93 93 { 94 pv = RTMemExecAlloc(cbAligned + sizeof(RTMEMHDRR3)); 95 if ((fFlags & RTMEMALLOCEX_FLAGS_ZEROED) && pv) 96 RT_BZERO(pv, cbAligned + sizeof(RTMEMHDRR3)); 94 pv = RTMemPageAlloc(cbAligned + sizeof(RTMEMHDRR3)); 95 if (pv) 96 { 97 if (fFlags & RTMEMALLOCEX_FLAGS_ZEROED) 98 RT_BZERO(pv, cbAligned + sizeof(RTMEMHDRR3)); 99 100 int rc = RTMemProtect(pv, cbAligned + sizeof(RTMEMHDRR3), RTMEM_PROT_EXEC | RTMEM_PROT_READ | RTMEM_PROT_WRITE); 101 if (RT_FAILURE(rc)) 102 { 103 RTMemPageFree(pv, cbAligned + sizeof(RTMEMHDRR3)); 104 return rc; 105 } 106 } 97 107 } 98 108 else if (fFlags & RTMEMALLOCEX_FLAGS_ZEROED) … … 132 142 rtMemFreeExYyBitReach(pHdr, pHdr->cb + sizeof(*pHdr), pHdr->fFlags); 133 143 else if (pHdr->fFlags & RTMEMALLOCEX_FLAGS_EXEC) 134 RTMemExecFree(pHdr, pHdr->cb + sizeof(*pHdr)); 144 { 145 RTMemProtect(pHdr, pHdr->cb + sizeof(*pHdr), RTMEM_PROT_READ | RTMEM_PROT_WRITE); 146 RTMemPageFree(pHdr, pHdr->cb + sizeof(*pHdr)); 147 } 135 148 else 136 149 RTMemFree(pHdr);
Note:
See TracChangeset
for help on using the changeset viewer.