Changeset 26525 in vbox for trunk/src/VBox/Runtime/common/alloc
- Timestamp:
- Feb 15, 2010 3:33:33 AM (15 years ago)
- Location:
- trunk/src/VBox/Runtime/common/alloc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/alloc/heapoffset.cpp
r26344 r26525 375 375 */ 376 376 AssertReturn(cbMemory >= PAGE_SIZE, VERR_INVALID_PARAMETER); 377 AssertReturn(cbMemory < UINT32_MAX, VERR_INVALID_PARAMETER); 377 378 AssertPtrReturn(pvMemory, VERR_INVALID_POINTER); 378 379 AssertReturn((uintptr_t)pvMemory + (cbMemory - 1) > (uintptr_t)cbMemory, VERR_INVALID_PARAMETER); … … 394 395 /* Init the heap anchor block. */ 395 396 pHeapInt->u32Magic = RTHEAPOFFSET_MAGIC; 396 pHeapInt->cbHeap = cbMemory;397 pHeapInt->cbFree = cbMemory397 pHeapInt->cbHeap = (uint32_t)cbMemory; 398 pHeapInt->cbFree = (uint32_t)cbMemory 398 399 - sizeof(RTHEAPOFFSETBLOCK) 399 400 - sizeof(RTHEAPOFFSETINTERNAL); -
trunk/src/VBox/Runtime/common/alloc/memcache.cpp
r26452 r26525 167 167 if (cbAlignment == 0) 168 168 { 169 cbAlignment = UINT32_C(1)<< ASMBitLastSetU32((uint32_t)cbObject);169 cbAlignment = (size_t)1 << ASMBitLastSetU32((uint32_t)cbObject); 170 170 if (cbAlignment > 64) 171 171 cbAlignment = 64; … … 191 191 192 192 pThis->u32Magic = RTMEMCACHE_MAGIC; 193 pThis->cbObject = RT_ALIGN_Z(cbObject, cbAlignment);194 pThis->cbAlignment = cbAlignment;195 pThis->cPerPage = ( PAGE_SIZE - RT_ALIGN_Z(sizeof(RTMEMCACHEPAGE), cbAlignment)) / pThis->cbObject;193 pThis->cbObject = (uint32_t)RT_ALIGN_Z(cbObject, cbAlignment); 194 pThis->cbAlignment = (uint32_t)cbAlignment; 195 pThis->cPerPage = (uint32_t)((PAGE_SIZE - RT_ALIGN_Z(sizeof(RTMEMCACHEPAGE), cbAlignment)) / pThis->cbObject); 196 196 while ( RT_ALIGN_Z(sizeof(RTMEMCACHEPAGE), RT_MIN(cbAlignment, 8)) 197 197 + pThis->cPerPage * pThis->cbObject
Note:
See TracChangeset
for help on using the changeset viewer.