My Project
Classes | Public Types | Public Member Functions | List of all members
ParaEngine::DL_Allocator< T, UserAllocator > Class Template Reference

this is a general single-threaded allocator, which is used by the main game (rendering) thread in ParaEngine. More...

#include <ParaMemPool.h>

Classes

struct  rebind
 

Public Types

typedef T value_type
 
typedef UserAllocator user_allocator
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 

Public Member Functions

 DL_Allocator (DL_Allocator const &)
 
template<typename U >
 DL_Allocator (DL_Allocator< U > const &)
 
pointer address (reference r)
 
const_pointer address (const_reference r)
 
size_type max_size () const
 
pointer allocate (size_type cnt, typename std::allocator< void >::const_pointer=0)
 
void deallocate (pointer p, size_type)
 
void construct (pointer p, const T &t)
 
void destroy (pointer p)
 
bool operator== (DL_Allocator const &)
 
bool operator!= (DL_Allocator const &a)
 

Detailed Description

template<typename T, typename UserAllocator>
class ParaEngine::DL_Allocator< T, UserAllocator >

this is a general single-threaded allocator, which is used by the main game (rendering) thread in ParaEngine.

it is for temporary small object allocations/dellocations. The current implementation is based on std::allocator and dlmalloc.

Parameters
UserAllocatorit default to dl_malloc, i.e. default_user_allocator_dl_malloc, other possible values are default_user_allocator_new_delete, default_user_allocator_malloc_free Examples: typedef ParaEngine::DL_Allocator<int> DL_Allocator_Int; typedef std::list<int, DL_Allocator_Int > List_Int_Type;

typedef ParaEngine::DL_Allocator<void*> DL_Allocator_Void; typedef std::list<void*, DL_Allocator_Void > List_Void_Type;


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