"Fossies" - the Fresh Open Source Software Archive  

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

basehoardmanager.h  (Hoard-3.12):basehoardmanager.h  (Hoard-3.13)
skipping to change at line 38 skipping to change at line 38
#ifndef HOARD_BASEHOARDMANAGER_H #ifndef HOARD_BASEHOARDMANAGER_H
#define HOARD_BASEHOARDMANAGER_H #define HOARD_BASEHOARDMANAGER_H
/** /**
* @class BaseHoardManager * @class BaseHoardManager
* @brief The top of the hoard manager hierarchy. * @brief The top of the hoard manager hierarchy.
* *
*/ */
#include "heaplayers.h" #include "heaplayers.h"
//#include "sassert.h"
namespace Hoard { namespace Hoard {
template <class SuperblockType_> template <class SuperblockType_>
class BaseHoardManager { class BaseHoardManager {
public: public:
BaseHoardManager (void) BaseHoardManager (void)
: _magic (0xedded00d) : _magic (0xedded00d)
{} {
static_assert((SuperblockSize & (SuperblockSize - 1)) == 0,
"Size of superblock must be a power of two.");
}
inline int isValid (void) const { inline int isValid (void) const {
return (_magic == 0xedded00d); return (_magic == 0xedded00d);
} }
// Export the superblock type. // Export the superblock type.
typedef SuperblockType_ SuperblockType; typedef SuperblockType_ SuperblockType;
/// Free an object. /// Free an object.
inline virtual void free (void *) {} inline virtual void free (void *) {}
skipping to change at line 84 skipping to change at line 86
/// @note All superblocks <em>must</em> be naturally aligned, and powers of two. /// @note All superblocks <em>must</em> be naturally aligned, and powers of two.
static inline SuperblockType * getSuperblock (void * ptr) { static inline SuperblockType * getSuperblock (void * ptr) {
return SuperblockType::getSuperblock (ptr); return SuperblockType::getSuperblock (ptr);
} }
private: private:
enum { SuperblockSize = sizeof(SuperblockType) }; enum { SuperblockSize = sizeof(SuperblockType) };
HL::sassert<((SuperblockSize & (SuperblockSize - 1)) == 0)> EnsureSuperblock
SizeIsPowerOfTwo;
const unsigned long _magic; const unsigned long _magic;
}; };
} }
#endif #endif
 End of changes. 3 change blocks. 
5 lines changed or deleted 4 lines changed or added

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