HL::SanityCheckHeap< SuperHeap > Class Template Reference

#include <sanitycheckheap.h>

Inheritance diagram for HL::SanityCheckHeap< SuperHeap >:
SuperHeap

List of all members.

Public Member Functions

void * malloc (size_t sz)
void free (void *ptr)

Private Types

enum  { FREED = -1 }
 

A freed object has a special size, -1.

More...
enum  { MALLOC_RETURNED_ALLOCATED_OBJECT = 0, FREE_CALLED_ON_OBJECT_I_NEVER_ALLOCATED = 0, FREE_CALLED_TWICE_ON_SAME_OBJECT = 0 }
 

"Error messages", used in asserts.

More...
typedef std::pair< const void
*, int > 
objType
 Define a local allocator that lets us use the SuperHeap for the map.
typedef HL::FreelistHeap
< HL::ZoneHeap< HL::MmapHeap, 16384 > > 
heapType
typedef HL::STLAllocator
< objType, heapType
localAllocator
typedef std::less< void * > localComparator
typedef std::map< void *, int,
localComparator,
localAllocator
mapType
 A map of pointers to objects and their allocated sizes.

Private Attributes

mapType allocatedObjects
 A map of tuples: (obj address, size).

template<class SuperHeap>
class HL::SanityCheckHeap< SuperHeap >


Member Typedef Documentation

template<class SuperHeap >
typedef HL::FreelistHeap<HL::ZoneHeap<HL::MmapHeap, 16384> > HL::SanityCheckHeap< SuperHeap >::heapType [private]
template<class SuperHeap >
typedef HL::STLAllocator<objType, heapType> HL::SanityCheckHeap< SuperHeap >::localAllocator [private]
template<class SuperHeap >
typedef std::less<void *> HL::SanityCheckHeap< SuperHeap >::localComparator [private]
template<class SuperHeap >
typedef std::map<void *, int, localComparator, localAllocator> HL::SanityCheckHeap< SuperHeap >::mapType [private]

A map of pointers to objects and their allocated sizes.

template<class SuperHeap >
typedef std::pair<const void *, int> HL::SanityCheckHeap< SuperHeap >::objType [private]

Define a local allocator that lets us use the SuperHeap for the map.

This approach lets us use SanityCheckHeaps when we're replacing malloc.


Member Enumeration Documentation

template<class SuperHeap >
anonymous enum [private]

A freed object has a special size, -1.

Enumerator:
FREED 
template<class SuperHeap >
anonymous enum [private]

"Error messages", used in asserts.

These must all equal zero.

Enumerator:
MALLOC_RETURNED_ALLOCATED_OBJECT 
FREE_CALLED_ON_OBJECT_I_NEVER_ALLOCATED 
FREE_CALLED_TWICE_ON_SAME_OBJECT 

Member Function Documentation

template<class SuperHeap >
void HL::SanityCheckHeap< SuperHeap >::free ( void *  ptr  )  [inline]
template<class SuperHeap >
void* HL::SanityCheckHeap< SuperHeap >::malloc ( size_t  sz  )  [inline]

Member Data Documentation

template<class SuperHeap >
mapType HL::SanityCheckHeap< SuperHeap >::allocatedObjects [private]

A map of tuples: (obj address, size).


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