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

#include <hoardsuperblockheader.h>

List of all members.

Public Member Functions

 HoardSuperblockHeader (size_t sz, size_t bufferSize)
void * malloc (void)
void free (void *ptr)
void clear (void)
INLINE void * normalize (void *ptr) const
 Returns the actual start of the object.
size_t getSize (void *ptr) const
size_t getObjectSize (void) const
int getTotalObjects (void) const
int getObjectsFree (void) const
HeapType * getOwner (void) const
void setOwner (HeapType *o)
bool isValid (void) const
HoardSuperblock< LockType,
SuperblockSize, HeapType > * 
getNext (void) const
HoardSuperblock< LockType,
SuperblockSize, HeapType > * 
getPrev (void) const
void setNext (HoardSuperblock< LockType, SuperblockSize, HeapType > *n)
void setPrev (HoardSuperblock< LockType, SuperblockSize, HeapType > *p)
void lock (void)
void unlock (void)

Private Types

enum  { MAGIC_NUMBER = 0xcafed00d }

Private Member Functions

MALLOC_FUNCTION INLINE void * reapAlloc (void)
MALLOC_FUNCTION INLINE void * freeListAlloc (void)

Private Attributes

const size_t _magicNumber
 A magic number used to verify validity of this header.
const size_t _objectSize
 The object size.
const bool _objectSizeIsPowerOfTwo
 True iff size is a power of two.
const int _totalObjects
 Total objects in the superblock.
LockType _theLock
 The lock.
HeapType * _owner
 The owner of this superblock.
HoardSuperblock< LockType,
SuperblockSize, HeapType > * 
_prev
 The preceding superblock in a linked list.
HoardSuperblock< LockType,
SuperblockSize, HeapType > * 
_next
 The succeeding superblock in a linked list.
int _reapableObjects
 The number of objects available to be 'reap'ed.
int _objectsFree
 The number of objects available for (re)use.
char * _start
 The start of reap allocation.
char * _position
 The cursor into the buffer following the header.
FreeSLList _freeList
 The list of freed objects.
union {
   char   _dchar
   short   _dshort
   int   _dint
   long   _dlong
   float   _dfloat
   double   _ddouble
   long double   _dldouble
}; 

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


Member Enumeration Documentation

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

Constructor & Destructor Documentation

template<class LockType , int SuperblockSize, typename HeapType >
Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::HoardSuperblockHeader ( size_t  sz,
size_t  bufferSize 
) [inline]

Member Function Documentation

template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::clear ( void   )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::free ( void *  ptr  )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
MALLOC_FUNCTION INLINE void* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::freeListAlloc ( void   )  [inline, private]
template<class LockType , int SuperblockSize, typename HeapType >
HoardSuperblock<LockType, SuperblockSize, HeapType>* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getNext ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
int Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getObjectsFree ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
size_t Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getObjectSize ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
HeapType* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getOwner ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
HoardSuperblock<LockType, SuperblockSize, HeapType>* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getPrev ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
size_t Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getSize ( void *  ptr  )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
int Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::getTotalObjects ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
bool Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::isValid ( void   )  const [inline]
template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::lock ( void   )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
void* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::malloc ( void   )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
INLINE void* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::normalize ( void *  ptr  )  const [inline]

Returns the actual start of the object.

template<class LockType , int SuperblockSize, typename HeapType >
MALLOC_FUNCTION INLINE void* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::reapAlloc ( void   )  [inline, private]
template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::setNext ( HoardSuperblock< LockType, SuperblockSize, HeapType > *  n  )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::setOwner ( HeapType *  o  )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::setPrev ( HoardSuperblock< LockType, SuperblockSize, HeapType > *  p  )  [inline]
template<class LockType , int SuperblockSize, typename HeapType >
void Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::unlock ( void   )  [inline]

Member Data Documentation

union { ... } [private]
template<class LockType , int SuperblockSize, typename HeapType >
char Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_dchar
template<class LockType , int SuperblockSize, typename HeapType >
double Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_ddouble
template<class LockType , int SuperblockSize, typename HeapType >
float Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_dfloat
template<class LockType , int SuperblockSize, typename HeapType >
int Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_dint
template<class LockType , int SuperblockSize, typename HeapType >
long double Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_dldouble
template<class LockType , int SuperblockSize, typename HeapType >
long Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_dlong
template<class LockType , int SuperblockSize, typename HeapType >
short Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_dshort
template<class LockType , int SuperblockSize, typename HeapType >
FreeSLList Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_freeList [private]

The list of freed objects.

template<class LockType , int SuperblockSize, typename HeapType >
const size_t Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_magicNumber [private]

A magic number used to verify validity of this header.

template<class LockType , int SuperblockSize, typename HeapType >
HoardSuperblock<LockType, SuperblockSize, HeapType>* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_next [private]

The succeeding superblock in a linked list.

template<class LockType , int SuperblockSize, typename HeapType >
int Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_objectsFree [private]

The number of objects available for (re)use.

template<class LockType , int SuperblockSize, typename HeapType >
const size_t Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_objectSize [private]

The object size.

template<class LockType , int SuperblockSize, typename HeapType >
const bool Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_objectSizeIsPowerOfTwo [private]

True iff size is a power of two.

template<class LockType , int SuperblockSize, typename HeapType >
HeapType* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_owner [private]

The owner of this superblock.

template<class LockType , int SuperblockSize, typename HeapType >
char* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_position [private]

The cursor into the buffer following the header.

template<class LockType , int SuperblockSize, typename HeapType >
HoardSuperblock<LockType, SuperblockSize, HeapType>* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_prev [private]

The preceding superblock in a linked list.

template<class LockType , int SuperblockSize, typename HeapType >
int Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_reapableObjects [private]

The number of objects available to be 'reap'ed.

template<class LockType , int SuperblockSize, typename HeapType >
char* Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_start [private]

The start of reap allocation.

template<class LockType , int SuperblockSize, typename HeapType >
LockType Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_theLock [private]

The lock.

template<class LockType , int SuperblockSize, typename HeapType >
const int Hoard::HoardSuperblockHeader< LockType, SuperblockSize, HeapType >::_totalObjects [private]

Total objects in the superblock.


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