/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/usr/diag/prdf/common/util/prdfHeapBucketSize.H $ */ /* */ /* IBM CONFIDENTIAL */ /* */ /* COPYRIGHT International Business Machines Corp. 2012 */ /* */ /* p1 */ /* */ /* Object Code Only (OCO) source materials */ /* Licensed Internal Code Source Materials */ /* IBM HostBoot Licensed Internal Code */ /* */ /* The source code for this program is not published or otherwise */ /* divested of its trade secrets, irrespective of what has been */ /* deposited with the U.S. Copyright Office. */ /* */ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ #ifndef PRDFHEAPBUCKETSIZE_H #define PRDFHEAPBUCKETSIZE_H namespace PRDF { //-------------------------------------------------------------------- // Includes //-------------------------------------------------------------------- #ifdef __HOSTBOOT_MODULE #include #endif #ifdef __HOSTBOOT_MODULE template struct HeapBucketSize { static const size_t value = HeapBucketSize::value + HeapBucketSize::value; }; template <> struct HeapBucketSize<0> { static const size_t value = HeapManager::BUCKET_SIZE0; }; template <> struct HeapBucketSize<1> { static const size_t value = HeapManager::BUCKET_SIZE1; }; template struct RoundBucketSize { static const size_t value = (sizeof(T) * S > (HeapBucketSize::value - sizeof(uint64_t))) ? (RoundBucketSize::value) : ((HeapBucketSize::value - sizeof(uint64_t)) / sizeof(T)); }; template struct RoundBucketSize { static const size_t value = S; }; #else template struct RoundBucketSize { static const size_t value = S; }; #endif } //End namespace PRDF #endif // define PRDFHEAPBUCKETSIZE_H