Qualia  0.2
Classes | Macros | Functions
Allocator.h File Reference
#include "common.h"
#include <new>
#include <stddef.h>
#include <stdlib.h>
Include dependency graph for Allocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Allocator
 
class  Alloc
 

Macros

#define Q_NEW(T)   new( Alloc::malloc(sizeof(T)) ) T
 Macro equivalent of new operator: allocates memory using Alloc::malloc(). More...
 
#define Q_ARRAY_NEW(T, n)   __Q_ARRAY_NEW<T>(n)
 

Functions

template<class T >
void Q_DELETE (T *obj)
 Template equivalent of delete operator: explicitely calls destuctor and releases memory using Alloc::free(). More...
 
template<class T >
T * __Q_ARRAY_NEW (size_t n)
 
template<class T >
void Q_ARRAY_DELETE (T *array)
 

Macro Definition Documentation

#define Q_ARRAY_NEW (   T,
 
)    __Q_ARRAY_NEW<T>(n)

Macro equivalent of new[] operator: allocates memory using Alloc::malloc(). Notice that this method allocates an extra (size_t) space to retrieve the number of allocated elements when calling Q_ARRAY_DELETE().

#define Q_NEW (   T)    new( Alloc::malloc(sizeof(T)) ) T

Macro equivalent of new operator: allocates memory using Alloc::malloc().

Function Documentation

template<class T >
T* __Q_ARRAY_NEW ( size_t  n)
template<class T >
void Q_ARRAY_DELETE ( T *  array)

Template equivalent of delete[] operator: explicitely calls destuctors and releases memory using Alloc::free().

template<class T >
void Q_DELETE ( T *  obj)

Template equivalent of delete operator: explicitely calls destuctor and releases memory using Alloc::free().