# Ogre::NedAlignedAllocPolicy< Alignment > Class Template Reference
[Memory]

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

`#include <OgreMemoryNedAlloc.h>`

List of all members.

## Public Types

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

## Static Public Member Functions

static void * | allocateBytes (size_t count, const char *file=0, int line=0, const char *func=0)
static void | deallocateBytes (void *ptr)
static size_t | getMaxAllocationSize ()
| Get the maximum size of a single allocation.

## Private Member Functions

| NedAlignedAllocPolicy ()

## Detailed Description

### template<size_t Alignment = 0>
class Ogre::NedAlignedAllocPolicy< Alignment >

An 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 allocation policy uses nedmalloc (http://nedprod.com/programs/portable/nedmalloc/index.html).

Note:
  template parameter Alignment equal to zero means use default platform dependent alignment.

Definition at line 101 of file OgreMemoryNedAlloc.h.

## Member Typedef Documentation

template<size_t Alignment = 0>

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

Definition at line 106 of file OgreMemoryNedAlloc.h.

## Constructor & Destructor Documentation

template<size_t Alignment = 0>

Ogre::NedAlignedAllocPolicy< Alignment >::NedAlignedAllocPolicy | ( |  | ) | `[private]`

Definition at line 126 of file OgreMemoryNedAlloc.h.

## Member Function Documentation

template<size_t Alignment = 0>

static void* Ogre::NedAlignedAllocPolicy< Alignment >::allocateBytes | ( | size_t | count,
|  | const char * | file = `0`,
|  | int | line = `0`,
|  | const char * | func = `0` |
| ) |  |  | `[static]`

Definition at line 108 of file OgreMemoryNedAlloc.h.

References Ogre::NedAllocImpl::allocBytesAligned().

template<size_t Alignment = 0>

static void Ogre::NedAlignedAllocPolicy< Alignment >::deallocateBytes | ( | void * | ptr | ) | `[static]`

Definition at line 114 of file OgreMemoryNedAlloc.h.

References Ogre::NedAllocImpl::deallocBytesAligned().

template<size_t Alignment = 0>

static size_t Ogre::NedAlignedAllocPolicy< Alignment >::getMaxAllocationSize | ( |  | ) | `[static]`

Get the maximum size of a single allocation.

Definition at line 120 of file OgreMemoryNedAlloc.h.

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

- OgreMemoryNedAlloc.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:24:56