Changeset 53684 in vbox
- Timestamp:
- Jan 2, 2015 12:40:26 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97461
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0/VBoxDTraceR0.cpp
r53682 r53684 53 53 #include <VBox/VBoxTpG.h> 54 54 55 56 /******************************************************************************* 57 * Defined Constants And Macros * 58 *******************************************************************************/ 59 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 60 # define HAVE_RTMEMALLOCEX_FEATURES 61 #endif 55 62 56 63 … … 643 650 { 644 651 struct VBoxDtCred *pCred; 652 #ifdef HAVE_RTMEMALLOCEX_FEATURES 645 653 int rc = RTMemAllocEx(sizeof(*pCred), 0, RTMEMALLOCEX_FLAGS_ANY_CTX, (void **)&pCred); 654 #else 655 int rc = RTMemAllocEx(sizeof(*pCred), 0, 0, (void **)&pCred); 656 #endif 646 657 AssertFatalRC(rc); 647 658 pCred->cr_refs = 1; … … 1123 1134 void *VBoxDtKMemAlloc(size_t cbMem, uint32_t fFlags) 1124 1135 { 1125 void *pvMem; 1126 int rc = RTMemAllocEx(cbMem, 0, fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0, &pvMem); 1136 void *pvMem; 1137 #ifdef HAVE_RTMEMALLOCEX_FEATURES 1138 uint32_t fMemAllocFlags = fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0; 1139 #else 1140 uint32_t fMemAllocFlags = 0; 1141 #endif 1142 int rc = RTMemAllocEx(cbMem, 0, fMemAllocFlags, &pvMem); 1127 1143 AssertRCReturn(rc, NULL); 1128 1144 AssertPtr(pvMem); … … 1134 1150 void *VBoxDtKMemAllocZ(size_t cbMem, uint32_t fFlags) 1135 1151 { 1136 void *pvMem; 1137 int rc = RTMemAllocEx(cbMem, 0, 1138 (fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0) | RTMEMALLOCEX_FLAGS_ZEROED, 1139 &pvMem); 1152 void *pvMem; 1153 #ifdef HAVE_RTMEMALLOCEX_FEATURES 1154 uint32_t fMemAllocFlags = (fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0) | RTMEMALLOCEX_FLAGS_ZEROED; 1155 #else 1156 uint32_t fMemAllocFlags = RTMEMALLOCEX_FLAGS_ZEROED; 1157 #endif 1158 int rc = RTMemAllocEx(cbMem, 0, fMemAllocFlags, &pvMem); 1140 1159 AssertRCReturn(rc, NULL); 1141 1160 AssertPtr(pvMem); … … 1204 1223 void *VBoxDtKMemCacheAlloc(struct VBoxDtMemCache *pThis, uint32_t fFlags) 1205 1224 { 1206 void *pvMem; 1207 int rc = RTMemAllocEx(pThis->cbBuf, 1208 pThis->cbAlign, 1209 (fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0) | RTMEMALLOCEX_FLAGS_ZEROED, 1210 &pvMem); 1225 void *pvMem; 1226 #ifdef HAVE_RTMEMALLOCEX_FEATURES 1227 uint32_t fMemAllocFlags = (fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0) | RTMEMALLOCEX_FLAGS_ZEROED; 1228 #else 1229 uint32_t fMemAllocFlags = RTMEMALLOCEX_FLAGS_ZEROED; 1230 #endif 1231 int rc = RTMemAllocEx(pThis->cbBuf, pThis->cbAlign, fMemAllocFlags, &pvMem); 1211 1232 AssertRCReturn(rc, NULL); 1212 1233 AssertPtr(pvMem);
Note:
See TracChangeset
for help on using the changeset viewer.