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

A "standard" allocation policy for use with AllocatedObject and STLAllocator, which aligns memory at a given boundary (which should be a power of 2). More...

#include <OgreMemoryStdAlloc.h>

Public Types

typedef int IsValidAlignment [Alignment<=128 &&((Alignment &(Alignment-1))==0)?+1:-1]
 

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

 StdAlignedAllocPolicy ()
 

Detailed Description

template<size_t Alignment = 0>
class Ogre::StdAlignedAllocPolicy< Alignment >

A "standard" allocation policy for use with AllocatedObject and STLAllocator, which aligns memory at a given boundary (which should be a power of 2).

This is the class that actually does the allocation and deallocation of physical memory, and is what you will want to provide a custom version of if you wish to change how memory is allocated.

This class just delegates to the global malloc/free, via AlignedMemory.
Note
template parameter Alignment equal to zero means use default platform dependent alignment.

Definition at line 107 of file OgreMemoryStdAlloc.h.

Member Typedef Documentation

template<size_t Alignment = 0>
typedef int Ogre::StdAlignedAllocPolicy< Alignment >::IsValidAlignment[Alignment<=128 &&((Alignment &(Alignment-1))==0)?+1:-1]

Definition at line 112 of file OgreMemoryStdAlloc.h.

Constructor & Destructor Documentation

template<size_t Alignment = 0>
Ogre::StdAlignedAllocPolicy< Alignment >::StdAlignedAllocPolicy ( )
inlineprivate

Definition at line 146 of file OgreMemoryStdAlloc.h.

Member Function Documentation

template<size_t Alignment = 0>
static DECL_MALLOC void* Ogre::StdAlignedAllocPolicy< Alignment >::allocateBytes ( size_t  count,
const char *  = 0,
int  = 0,
const char *  = 0 
)
inlinestatic

Definition at line 114 of file OgreMemoryStdAlloc.h.

References Ogre::AlignedMemory::allocate().

template<size_t Alignment = 0>
static void Ogre::StdAlignedAllocPolicy< Alignment >::deallocateBytes ( void *  ptr)
inlinestatic

Definition at line 131 of file OgreMemoryStdAlloc.h.

References Ogre::AlignedMemory::deallocate().

template<size_t Alignment = 0>
static size_t Ogre::StdAlignedAllocPolicy< Alignment >::getMaxAllocationSize ( )
inlinestatic

Get the maximum size of a single allocation.

Definition at line 140 of file OgreMemoryStdAlloc.h.

References Ogre::max().


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