Changeset 55256 in vbox for trunk/src/VBox/Runtime/common/alloc
- Timestamp:
- Apr 14, 2015 3:46:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/alloc/memcache.cpp
r55253 r55256 350 350 DECL_FORCE_INLINE(int32_t) rtMemCacheGrabObj(PRTMEMCACHEPAGE pPage) 351 351 { 352 int32_t cFreeNew = ASMAtomicDecS32(&pPage->cFree); 353 if (cFreeNew < 0) 354 { 352 if (ASMAtomicUoReadS32(&pPage->cFree) > 0) 353 { 354 int32_t cFreeNew = ASMAtomicDecS32(&pPage->cFree); 355 if (cFreeNew >= 0) 356 return cFreeNew; 355 357 ASMAtomicIncS32(&pPage->cFree); 356 return -1; 357 } 358 return cFreeNew; 358 } 359 return -1; 359 360 } 360 361 … … 414 415 * Grab a free object at the page level. 415 416 */ 416 PRTMEMCACHEPAGE pPage = ASMAtomic ReadPtrT(&pThis->pPageHint, PRTMEMCACHEPAGE);417 PRTMEMCACHEPAGE pPage = ASMAtomicUoReadPtrT(&pThis->pPageHint, PRTMEMCACHEPAGE); 417 418 int32_t iObj = pPage ? rtMemCacheGrabObj(pPage) : -1; 418 419 if (iObj < 0)
Note:
See TracChangeset
for help on using the changeset viewer.