Changeset 78334 in vbox for trunk/src/VBox/Runtime/r3/win
- Timestamp:
- Apr 26, 2019 7:53:32 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/alloc-win.cpp
r76553 r78334 96 96 97 97 98 RTDECL(void *) RTMemPageAllocExTag(size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW_DEF 99 { 100 size_t const cbAligned = RT_ALIGN_Z(cb, PAGE_SIZE); 101 RT_NOREF_PV(pszTag); 102 AssertReturn(!(fFlags & ~RTMEMPAGEALLOC_F_VALID_MASK), NULL); 103 104 #ifdef USE_VIRTUAL_ALLOC 105 void *pv = VirtualAlloc(NULL, cbAligned, MEM_COMMIT, PAGE_READWRITE); 106 #else 107 void *pv = _aligned_malloc(cbAligned, PAGE_SIZE); 108 #endif 109 AssertMsgReturn(pv, ("cb=%d lasterr=%d\n", cb, GetLastError()), NULL); 110 111 if (fFlags & RTMEMPAGEALLOC_F_ADVISE_LOCKED) 112 { 113 BOOL const fOkay = VirtualLock(pv, cbAligned); 114 AssertMsg(fOkay, ("pv=%p cb=%d lasterr=%d\n", pv, cb, GetLastError())); 115 NOREF(fOkay); 116 } 117 118 if (fFlags & RTMEMPAGEALLOC_F_ZERO) 119 RT_BZERO(pv, cbAligned); 120 121 return pv; 122 } 123 124 98 125 RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF 99 126 {
Note:
See TracChangeset
for help on using the changeset viewer.