Classes |
class | sanityCheck |
Public Types |
enum | { Alignment = sizeof(double)
} |
| This heap guarantees only double-word alignment.
More...
|
typedef SuperblockType_ | SuperblockType |
Public Member Functions |
| HoardManager (void) |
virtual | ~HoardManager (void) |
MALLOC_FUNCTION INLINE void * | malloc (size_t sz) |
NO_INLINE void | put (SuperblockType *s, size_t sz) |
| Put a superblock on this heap.
|
NO_INLINE SuperblockType * | get (size_t sz, HeapType *dest) |
| Get an empty (or nearly-empty) superblock.
|
INLINE void | free (void *ptr) |
| Return one object to its superblock and update stats.
|
INLINE void | lock (void) |
| Lock this memory manager.
|
INLINE void | unlock (void) |
| Unlock this memory manager.
|
NO_INLINE void * | getAnotherSuperblock (size_t sz) |
Private Types |
enum | { SuperblockSize = sizeof(SuperblockType_)
} |
enum | { MAGIC_NUMBER = 0xfeeddadd
} |
enum | { NumBins = binType::NUM_BINS
} |
| How many bins do we need to maintain?
More...
|
typedef BaseHoardManager
< SuperblockType_ > | SuperHeap |
typedef HL::bins< typename
SuperblockType::Header,
SuperblockSize > | binType |
| The type of the bin manager.
|
typedef SuperblockType * | SuperblockTypePointer |
typedef EmptyClass
< SuperblockType,
EmptinessClasses > | OrganizedByEmptiness |
typedef ManageOneSuperblock
< OrganizedByEmptiness > | BinManager |
Private Member Functions |
int | isValid (void) const |
NO_INLINE void | slowPathFree (int binIndex, int u, int a) |
NO_INLINE void | unlocked_put (SuperblockType *s, size_t sz) |
void | addStatsSuperblock (SuperblockType *s, int binIndex) |
void | decStatsSuperblock (SuperblockType *s, int binIndex) |
MALLOC_FUNCTION NO_INLINE void * | slowPathMalloc (size_t sz) |
MALLOC_FUNCTION INLINE void * | getObject (int binIndex, size_t sz) |
| Get one object of a particular size.
|
Private Attributes |
HL::sassert<((SuperblockSize
&(SuperblockSize-1))==0)> | verifyPowerOfTwo |
| Ensure that the superblock size is a power of two.
|
const unsigned long | _magic |
| A magic number used for debugging.
|
sassert< sizeof(typename
SuperblockType::Header)%sizeof(double)==0 > | verifyHeaderRightSize |
LockType | _theLock |
Array< NumBins, Statistics > | _stats |
| Usage statistics for each bin.
|
Array< NumBins, BinManager > | _otherBins |
| Bins that hold superblocks for each size class.
|
ParentHeap | _ph |
| The parent heap.
|
SourceHeap | _sourceHeap |
| Where memory comes from.
|
Friends |
class | sanityCheck |
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
typedef HL::bins<typename SuperblockType::Header, SuperblockSize> Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::binType [private] |
The type of the bin manager.
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
This heap guarantees only double-word alignment.
- Enumerator:
-
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
How many bins do we need to maintain?
- Enumerator:
-
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
INLINE void Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::free |
( |
void * |
ptr |
) |
[inline, virtual] |
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
NO_INLINE SuperblockType* Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::get |
( |
size_t |
sz, |
|
|
HeapType * |
dest | |
|
) |
| | [inline] |
Get an empty (or nearly-empty) superblock.
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
MALLOC_FUNCTION INLINE void* Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::getObject |
( |
int |
binIndex, |
|
|
size_t |
sz | |
|
) |
| | [inline, private] |
Get one object of a particular size.
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
INLINE void Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::lock |
( |
void |
|
) |
[inline, virtual] |
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
INLINE void Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::unlock |
( |
void |
|
) |
[inline, virtual] |
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
const unsigned long Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::_magic [private] |
template<class SourceHeap, class ParentHeap, class SuperblockType_, int EmptinessClasses, class LockType, class thresholdFunctionClass, class HeapType>
HL::sassert<((SuperblockSize & (SuperblockSize-1)) == 0)> Hoard::HoardManager< SourceHeap, ParentHeap, SuperblockType_, EmptinessClasses, LockType, thresholdFunctionClass, HeapType >::verifyPowerOfTwo [private] |
Ensure that the superblock size is a power of two.