Menu

object::NewAllocator Class Reference

Allocator using standard C++ new and delete operators. More...

#include <Allocator.h>

Public Types

typedef unsigned int SizeT
 Type to use for sizes.

Static Public Member Functions

static uint8_t * alloc (SizeT bytes)
 Allocate raw memory (no constructor call).
static void free (uint8_t *p)
 Free memory previously allocated by alloc().
template<typename T >
static T * alloc_array (SizeT num)
 Allocate array (no constructor call).
template<typename T >
static void free_array (T *p)
 Free array previously allocated by alloc_array().
template<typename T >
static void destroy (T *p)
 Destruct and free object previously allocated by allocator new.

Detailed Description

Allocator using standard C++ new and delete operators.

See also:
object/Allocator.h

Member Typedef Documentation

typedef unsigned int object::NewAllocator::SizeT

Type to use for sizes.


Member Function Documentation

static uint8_t* object::NewAllocator::alloc ( SizeT  bytes  )  [inline, static]

Allocate raw memory (no constructor call).

Parameters:
bytes Number of bytes to allocate
Returns:
Pointer to uninitialized allocated memory or NULL on error.

Referenced by alloc_array().

template<typename T >
static T* object::NewAllocator::alloc_array ( SizeT  num  )  [inline, static]

Allocate array (no constructor call).

Template Parameters:
T Array element type
Parameters:
num Number of T items to allocate
Returns:
Pointer to uninitialized allocated memory or NULL on error.

References alloc().

template<typename T >
static void object::NewAllocator::destroy ( T *  p  )  [inline, static]

Destruct and free object previously allocated by allocator new.

Parameters:
p Pointer to object to free

References free().

static void object::NewAllocator::free ( uint8_t *  p  )  [inline, static]

Free memory previously allocated by alloc().

Parameters:
p Pointer to memory to free

Referenced by destroy(), and free_array().

template<typename T >
static void object::NewAllocator::free_array ( T *  p  )  [inline, static]

Free array previously allocated by alloc_array().

Parameters:
p Pointer to memory to free
Note:
Does not call destuctors!

References free().


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