Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType > Class Template Reference

#include <hoardsuperblock.h>

List of all members.

Public Types

typedef
Hoard::HoardSuperblockHeader
< LockType, SuperblockSize,
HeapType > 
Header

Public Member Functions

 HoardSuperblock (size_t sz)
INLINE size_t getSize (void *ptr) const
INLINE size_t getObjectSize (void) const
MALLOC_FUNCTION INLINE void * malloc (size_t sz)
INLINE void free (void *ptr)
void clear (void)
INLINE bool isValidSuperblock (void) const
INLINE int getTotalObjects (void) const
INLINE int getObjectsFree (void) const
 Return the number of free objects in this superblock.
void lock (void)
void unlock (void)
HeapType * getOwner (void) const
void setOwner (HeapType *o)
HoardSuperblockgetNext (void) const
HoardSuperblockgetPrev (void) const
void setNext (HoardSuperblock *f)
void setPrev (HoardSuperblock *f)
INLINE bool inRange (void *ptr) const
INLINE void * normalize (void *ptr) const

Static Public Member Functions

static HoardSuperblockgetSuperblock (void *ptr)
 Find the start of the superblock by bitmasking.

Private Types

enum  { BufferSize = SuperblockSize - sizeof(Header) }

Private Member Functions

 HoardSuperblock (const HoardSuperblock &)
HoardSuperblockoperator= (const HoardSuperblock &)

Private Attributes

Header _header
 The metadata.
char _buf [BufferSize]
 The actual buffer. MUST immediately follow the header!

template<class LockType, int SuperblockSize, typename HeapType>
class Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >


Member Typedef Documentation

template<class LockType, int SuperblockSize, typename HeapType>
typedef Hoard::HoardSuperblockHeader<LockType, SuperblockSize, HeapType> Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::Header

Member Enumeration Documentation

template<class LockType, int SuperblockSize, typename HeapType>
anonymous enum [private]
Enumerator:
BufferSize 

Constructor & Destructor Documentation

template<class LockType, int SuperblockSize, typename HeapType>
Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::HoardSuperblock ( size_t  sz  )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::HoardSuperblock ( const HoardSuperblock< LockType, SuperblockSize, HeapType > &   )  [private]

Member Function Documentation

template<class LockType, int SuperblockSize, typename HeapType>
void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::clear ( void   )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
INLINE void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::free ( void *  ptr  )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
HoardSuperblock* Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getNext ( void   )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
INLINE int Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getObjectsFree ( void   )  const [inline]

Return the number of free objects in this superblock.

template<class LockType, int SuperblockSize, typename HeapType>
INLINE size_t Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getObjectSize ( void   )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
HeapType* Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getOwner ( void   )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
HoardSuperblock* Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getPrev ( void   )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
INLINE size_t Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getSize ( void *  ptr  )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
static HoardSuperblock* Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getSuperblock ( void *  ptr  )  [inline, static]

Find the start of the superblock by bitmasking.

Note:
All superblocks must be naturally aligned, and powers of two.
template<class LockType, int SuperblockSize, typename HeapType>
INLINE int Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::getTotalObjects ( void   )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
INLINE bool Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::inRange ( void *  ptr  )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
INLINE bool Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::isValidSuperblock ( void   )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::lock ( void   )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
MALLOC_FUNCTION INLINE void* Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::malloc ( size_t  sz  )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
INLINE void* Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::normalize ( void *  ptr  )  const [inline]
template<class LockType, int SuperblockSize, typename HeapType>
HoardSuperblock& Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::operator= ( const HoardSuperblock< LockType, SuperblockSize, HeapType > &   )  [private]
template<class LockType, int SuperblockSize, typename HeapType>
void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::setNext ( HoardSuperblock< LockType, SuperblockSize, HeapType > *  f  )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::setOwner ( HeapType *  o  )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::setPrev ( HoardSuperblock< LockType, SuperblockSize, HeapType > *  f  )  [inline]
template<class LockType, int SuperblockSize, typename HeapType>
void Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::unlock ( void   )  [inline]

Member Data Documentation

template<class LockType, int SuperblockSize, typename HeapType>
char Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::_buf[BufferSize] [private]

The actual buffer. MUST immediately follow the header!

template<class LockType, int SuperblockSize, typename HeapType>
Header Hoard::HoardSuperblock< LockType, SuperblockSize, HeapType >::_header [private]

The metadata.


The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:31 2011 for Galois by  doxygen 1.6.3