#include <sanitycheckheap.h>
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). |
typedef HL::FreelistHeap<HL::ZoneHeap<HL::MmapHeap, 16384> > HL::SanityCheckHeap< SuperHeap >::heapType [private] |
typedef HL::STLAllocator<objType, heapType> HL::SanityCheckHeap< SuperHeap >::localAllocator [private] |
typedef std::less<void *> HL::SanityCheckHeap< SuperHeap >::localComparator [private] |
typedef std::map<void *, int, localComparator, localAllocator> HL::SanityCheckHeap< SuperHeap >::mapType [private] |
A map of pointers to objects and their allocated sizes.
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.
anonymous enum [private] |
anonymous enum [private] |
void HL::SanityCheckHeap< SuperHeap >::free | ( | void * | ptr | ) | [inline] |
void* HL::SanityCheckHeap< SuperHeap >::malloc | ( | size_t | sz | ) | [inline] |
mapType HL::SanityCheckHeap< SuperHeap >::allocatedObjects [private] |
A map of tuples: (obj address, size).