OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::TrackAllocPolicy Class Reference

An allocation policy that preallocates a fixed amount of memory and always returns a deterministic pool. More...

#include <OgreMemoryTrackAlloc.h>

Static Public Member Functions

static DECL_MALLOC void * allocateBytes (size_t count, const char *=0, int=0, const char *=0)
 
static void deallocateBytes (void *_ptr)
 
static size_t getMaxAllocationSize ()
 Get the maximum size of a single allocation. More...
 

Private Member Functions

 TrackAllocPolicy ()
 

Static Private Attributes

static size_t CurrentOffset
 
static char Magic [4]
 
static char * MemoryPool
 
static size_t RandomOffset
 

Detailed Description

An allocation policy that preallocates a fixed amount of memory and always returns a deterministic pool.

Very useful for catching memory corruption errors (but not memory leaks). It uses huge amounts of RAM, so you better use 64-bit builds.

Definition at line 55 of file OgreMemoryTrackAlloc.h.

Constructor & Destructor Documentation

Ogre::TrackAllocPolicy::TrackAllocPolicy ( )
inlineprivate

Definition at line 79 of file OgreMemoryTrackAlloc.h.

Member Function Documentation

static DECL_MALLOC void* Ogre::TrackAllocPolicy::allocateBytes ( size_t  count,
const char *  = 0,
int  = 0,
const char *  = 0 
)
static
static void Ogre::TrackAllocPolicy::deallocateBytes ( void *  _ptr)
static
static size_t Ogre::TrackAllocPolicy::getMaxAllocationSize ( )
inlinestatic

Get the maximum size of a single allocation.

Definition at line 73 of file OgreMemoryTrackAlloc.h.

References OGRE_TRACK_POOL_SIZE.

Member Data Documentation

size_t Ogre::TrackAllocPolicy::CurrentOffset
staticprivate

Definition at line 58 of file OgreMemoryTrackAlloc.h.

char Ogre::TrackAllocPolicy::Magic[4]
staticprivate

Definition at line 59 of file OgreMemoryTrackAlloc.h.

char* Ogre::TrackAllocPolicy::MemoryPool
staticprivate

Definition at line 57 of file OgreMemoryTrackAlloc.h.

size_t Ogre::TrackAllocPolicy::RandomOffset
staticprivate

Definition at line 60 of file OgreMemoryTrackAlloc.h.


The documentation for this class was generated from the following file: