"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/include/hoard/thresholdsegheap.h" between
Hoard-3.12.tar.gz and Hoard-3.13.tar.gz

About: The Hoard memory allocator is a drop-in replacement for malloc() that can improve application performance, especially for multithreaded programs running on multiprocessors (hint: newer releases now part of the HeapLayers package).

thresholdsegheap.h  (Hoard-3.12):thresholdsegheap.h  (Hoard-3.13)
skipping to change at line 47 skipping to change at line 47
} }
// Once the amount of cached memory in the superheap exceeds the // Once the amount of cached memory in the superheap exceeds the
// desired threshold over max live requested by the client, dump // desired threshold over max live requested by the client, dump
// it all. // it all.
const int sizeClass = getSizeClass (sz); const int sizeClass = getSizeClass (sz);
const size_t maxSz = getClassMaxSize (sizeClass); const size_t maxSz = getClassMaxSize (sizeClass);
if (sizeClass >= NumBins) { if (sizeClass >= NumBins) {
return BigHeap::malloc (maxSz); return BigHeap::malloc (maxSz);
} else { } else {
void * ptr = _heap[sizeClass].malloc (maxSz); void * ptr = _heap[sizeClass].malloc (maxSz);
if (ptr == NULL) { if (ptr == nullptr) {
return BigHeap::malloc (maxSz); return BigHeap::malloc (maxSz);
} }
assert (getSize(ptr) <= maxSz); assert (getSize(ptr) <= maxSz);
_currLive += getSize (ptr); _currLive += getSize (ptr);
if (_currLive >= _maxLive) { if (_currLive >= _maxLive) {
_maxLive = _currLive; _maxLive = _currLive;
_cleared = false; _cleared = false;
} }
return ptr; return ptr;
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)