My Project
|
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 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) |
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.
UserAllocator | it 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;