- Timestamp:
- Jan 30, 2020 1:52:30 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
r80334 r82928 38 38 #define NUM_CPUS 16 39 39 40 #define OUTPUT(a) do { Log(a); RTPrintf a; } while (0) 40 41 41 42 /** … … 182 183 183 184 /* free and allocate the same node again. */ 185 MMHyperHeapDump(pVM); 184 186 for (i = 0; i < RT_ELEMENTS(aOps); i++) 185 187 { … … 187 189 || aOps[i].uAlignment == PAGE_SIZE) 188 190 continue; 189 //size_t cbBeforeSub = MMHyperHeapGetFreeSize(pVM);191 size_t cbBeforeSub = MMHyperHeapGetFreeSize(pVM); 190 192 rc = MMHyperFree(pVM, aOps[i].pvAlloc); 191 193 if (RT_FAILURE(rc)) … … 194 196 return 1; 195 197 } 196 //RTPrintf("debug: i=%d cbBeforeSub=%d now=%d\n", i, cbBeforeSub, MMHyperHeapGetFreeSize(pVM));198 size_t const cbFreed = MMHyperHeapGetFreeSize(pVM); 197 199 void *pv; 198 200 rc = MMHyperAlloc(pVM, aOps[i].cb, aOps[i].uAlignment, MM_TAG_VM_REQ, &pv); … … 208 210 } 209 211 aOps[i].pvAlloc = pv; 210 #if 0 /* won't work :/ */ 212 OUTPUT(("debug: i=%02d cbBeforeSub=%d cbFreed=%d now=%d\n", i, cbBeforeSub, cbFreed, MMHyperHeapGetFreeSize(pVM))); 213 #if 0 /* won't work :/ */ 211 214 size_t cbAfterSub = MMHyperHeapGetFreeSize(pVM); 212 215 if (cbBeforeSub != cbAfterSub) … … 215 218 return 1; 216 219 } 217 #endif220 #endif 218 221 } 219 222 … … 228 231 || !aOps[j].pvAlloc) 229 232 continue; 230 RTPrintf("j=%d i=%d free=%d cb=%d pv=%p\n", j, i, MMHyperHeapGetFreeSize(pVM), aOps[j].cb, aOps[j].pvAlloc);233 OUTPUT(("j=%02d i=%02d free=%d cb=%5u pv=%p\n", j, i, MMHyperHeapGetFreeSize(pVM), aOps[j].cb, aOps[j].pvAlloc)); 231 234 if (aOps[j].uAlignment == PAGE_SIZE) 232 235 cbBefore -= aOps[j].cb; … … 245 248 } 246 249 Assert(cFreed == RT_ELEMENTS(aOps)); 247 RTPrintf("i=done free=%d\n", MMHyperHeapGetFreeSize(pVM));250 OUTPUT(("i=done free=%d\n", MMHyperHeapGetFreeSize(pVM))); 248 251 249 252 /* check that we're back at the right amount of free memory. */ … … 251 254 if (cbBefore != cbAfter) 252 255 { 253 RTPrintf("Warning: Either we've split out an alignment chunk at the start, or we've got\n"254 " an alloc/free accounting bug: cbBefore=%d cbAfter=%d\n", cbBefore, cbAfter);256 OUTPUT(("Warning: Either we've split out an alignment chunk at the start, or we've got\n" 257 " an alloc/free accounting bug: cbBefore=%d cbAfter=%d\n", cbBefore, cbAfter)); 255 258 #ifdef DEBUG 256 259 MMHyperHeapDump(pVM);
Note:
See TracChangeset
for help on using the changeset viewer.

