"Fossies" - the Fresh Open Source Software Archive  

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

lockmallocheap.h  (Hoard-3.12):lockmallocheap.h  (Hoard-3.13)
skipping to change at line 35 skipping to change at line 35
*/ */
#ifndef HOARD_LOCKMALLOCHEAP_H #ifndef HOARD_LOCKMALLOCHEAP_H
#define HOARD_LOCKMALLOCHEAP_H #define HOARD_LOCKMALLOCHEAP_H
// Just lock malloc (unlike LockedHeap, which locks both malloc and // Just lock malloc (unlike LockedHeap, which locks both malloc and
// free). Meant to be combined with something like RedirectFree, which will // free). Meant to be combined with something like RedirectFree, which will
// implement free. // implement free.
#include <mutex>
namespace Hoard { namespace Hoard {
template <typename Heap> template <typename Heap>
class LockMallocHeap : public Heap { class LockMallocHeap : public Heap {
public: public:
MALLOC_FUNCTION INLINE void * malloc (size_t sz) { MALLOC_FUNCTION INLINE void * malloc (size_t sz) {
HL::Guard<Heap> l (*this); std::lock_guard<Heap> l (*this);
return Heap::malloc (sz); return Heap::malloc (sz);
} }
}; };
} }
#endif #endif
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

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