iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Optimized memory allocation using alignment and/or caching of memory blocks

Classes

class  nrt::Allocator< T >
 A C++ STL compatible allocator using nrt::allocate. More...
 
class  nrt::AlignedAllocator< T, N >
 A c++ STL compatible allocator that always performs aligned allocation. More...
 

Functions

void * nrt::allocate (size_t nbytes)
 Allocate nbytes of memory, throwing an exception in case of failure.
 
void nrt::deallocate (void *mem)
 Deallocate the given memory region.
 
void nrt::allocation_release_free_mem ()
 Released any cached free memory blocks (e.g. to conserve memory)
 
void nrt::allocation_allow_caching (bool on)
 Turn on/off caching of memory blocks of commonly-used sizes.
 
void nrt::allocation_debug_print (bool print)
 Turn on/off memory-allocation debugging statements. More...
 
void nrt::allocation_show_stats (int verbosity=0, const char *pfx=0, const size_t units=0)
 Print current stats for whatever memory allocator is in use. More...
 
void nrt::allocation_set_stats_units (const size_t units)
 Set the units to be used by default in invt_allocation_show_stats()
 

Function Documentation

void nrt::allocation_debug_print ( bool  print)

Turn on/off memory-allocation debugging statements.

If on, each nrt::allocate() and nrt::deallocate() call will print some stats about the memory block being currently allocated/deallocated, as well as some general stats about the total amount of memory allocated and the amount of memory currently in use

void nrt::allocation_show_stats ( int  verbosity = 0,
const char *  pfx = 0,
const size_t  units = 0 
)

Print current stats for whatever memory allocator is in use.

Parameters
verbosityIf greater than 0, will request additional stats to be displayed
pfxIf non-null, will be printed at the beginning of each stats line.
unitsIf non-zero, allocated memory blocks will be listed as multiples of this number of bytes; otherwise memory blocks will be listed as multiples of the units specified in the most recent call to allocation_set_stats_units().
Examples:
tests/test-Geometry.C.