HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SmallAlloc Class Reference

#include <UT_SmallAlloc.h>

Public Member Functions

 UT_SmallAlloc (size_t page_size=1024)
 
 ~UT_SmallAlloc ()
 
template<typename T >
TallocArray (exint size)
 
const char * allocString (const char *str)
 
voidalloc (size_t bytes)
 
void clear ()
 
int64 getMemoryUsage () const
 

Detailed Description

UT_SmallAlloc manages the allocation of small (and possibly variable sized) blocks of memory. Memory is stored in pages of a specified size with one wasted pointer at the beginning of the block storing a link to the next page. Memory is deallocated on destruction.

Definition at line 24 of file UT_SmallAlloc.h.

Constructor & Destructor Documentation

UT_SmallAlloc::UT_SmallAlloc ( size_t  page_size = 1024)
UT_SmallAlloc::~UT_SmallAlloc ( )

Member Function Documentation

void* UT_SmallAlloc::alloc ( size_t  bytes)
template<typename T >
T* UT_SmallAlloc::allocArray ( exint  size)
inline

Definition at line 33 of file UT_SmallAlloc.h.

const char* UT_SmallAlloc::allocString ( const char *  str)
inline

Definition at line 37 of file UT_SmallAlloc.h.

void UT_SmallAlloc::clear ( )
int64 UT_SmallAlloc::getMemoryUsage ( ) const
inline

Definition at line 50 of file UT_SmallAlloc.h.


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