GUIPoolAllocator_t Class Reference

Pool allocator for use only from the GUI thread to minimize memory fragmentation. More...

#include <UTGUIPoolAllocator.h>

Inheritance diagram for GUIPoolAllocator_t:
PoolAllocator_t

List of all members.

Public Member Functions

 GUIPoolAllocator_t ()
 ~GUIPoolAllocator_t ()
void * Allocate (size_t size)
void Release (void *block)

Detailed Description

Non-core library: UTgui

GUI objects pool allocator implementation to minimize memory fragmentation. This class can only be used from the main (GUI) thread. A single global instance is provided as g_gui_pool_allocator. This should only be used for reasonably short-lived and frequently allocated objects, otherwise as pools are freed in an attempt to keep that memory fragmentation to a minimum, the old blocks will stay allocated and actually make matters worse. If a pool block has been leaked, build the UT libraries with TRACE_LEAKED_POOL_BLOCK to diagnose where the block was allocated. That facility is only available in debug builds.

Definition at line 41 of file UTGUIPoolAllocator.h.


Constructor & Destructor Documentation

GUIPoolAllocator_t::GUIPoolAllocator_t (  ) 

Constructor.

GUIPoolAllocator_t::~GUIPoolAllocator_t (  ) 

Destructor.


Member Function Documentation

void * GUIPoolAllocator_t::Allocate ( size_t  size  )  [inline]

Allocates a block from the block pool.

Reimplemented from PoolAllocator_t.

Definition at line 92 of file UTGUIPoolAllocator.h.

void GUIPoolAllocator_t::Release ( void *  block  )  [inline]

Releases a block back to the block pool.

Reimplemented from PoolAllocator_t.

Definition at line 100 of file UTGUIPoolAllocator.h.


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

Generated on Tue Dec 14 22:35:06 2010 for UT library by  doxygen 1.6.1