"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/include/util/threadpoolheap.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).

threadpoolheap.h  (Hoard-3.12):threadpoolheap.h  (Hoard-3.13)
skipping to change at line 51 skipping to change at line 51
class PerThreadHeap_> class PerThreadHeap_>
class ThreadPoolHeap : public PerThreadHeap_ { class ThreadPoolHeap : public PerThreadHeap_ {
public: public:
typedef PerThreadHeap_ PerThreadHeap; typedef PerThreadHeap_ PerThreadHeap;
enum { MaxThreads = NumThreads }; enum { MaxThreads = NumThreads };
enum { NumThreadsMask = NumThreads - 1}; enum { NumThreadsMask = NumThreads - 1};
enum { NumHeapsMask = NumHeaps - 1}; enum { NumHeapsMask = NumHeaps - 1};
HL::sassert<((NumHeaps & NumHeapsMask) == 0)> verifyPowerOfTwoHeaps;
HL::sassert<((NumThreads & NumThreadsMask) == 0)> verifyPowerOfTwoThreads;
enum { MaxHeaps = NumHeaps }; enum { MaxHeaps = NumHeaps };
ThreadPoolHeap() ThreadPoolHeap()
{ {
static_assert((NumHeaps & NumHeapsMask) == 0,
"Number of heaps must be a power of two.");
static_assert((NumThreads & NumThreadsMask) == 0,
"Number of threads must be a power of two.");
// Note: The tidmap values should be set externally. // Note: The tidmap values should be set externally.
int j = 0; int j = 0;
for (int i = 0; i < NumThreads; i++) { for (int i = 0; i < NumThreads; i++) {
setTidMap(i, j % NumHeaps); setTidMap(i, j % NumHeaps);
j++; j++;
} }
} }
inline PerThreadHeap& getHeap (void) { inline PerThreadHeap& getHeap (void) {
auto tid = HL::CPUInfo::getThreadId(); auto tid = HL::CPUInfo::getThreadId();
 End of changes. 2 change blocks. 
3 lines changed or deleted 5 lines changed or added

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