
Definition in file AllocAux.C.
#include "Util/AllocAux.H"
#include "Util/Assert.H"
#include "Util/log.H"
#include "Util/sformat.H"
#include "rutz/freelist.h"
#include "rutz/mutex.h"
#include "rutz/trace.h"
#include <map>
#include <pthread.h>
Include dependency graph for AllocAux.C:

Go to the source code of this file.
Defines | |
| #define | DO_ALIGN |
| #define | DO_FASTCACHE |
| #define | NALIGN ( (4*sizeof(void*)) > 16 ? (4*sizeof(void*)) : 16 ) |
| #define | NCACHE 64 |
Typedefs | |
|
typedef aligned_alloc< fastcache_alloc< NCACHE >, NALIGN > | g_alloc_type |
Functions | |
| void * | invt_allocate_aux (size_t user_nbytes) |
| Allocate nbytes of memory, throwing an exception in case of failure. | |
| void | invt_deallocate_aux (void *mem) |
| Deallocate the given memory region. | |
| void | invt_allocation_release_free_mem () |
| Released any cached free memory blocks (e.g. to conserve memory). | |
| void | invt_allocation_allow_caching (bool on) |
| Turn on/off caching of memory blocks of commonly-used sizes. | |
| void | invt_allocation_debug_print (bool do_debug) |
| Turn on/off memory-allocation debugging statements. | |
| void | invt_allocation_show_stats (int verbosity, const char *pfx, const size_t block_size) |
| Print current stats for whatever memory allocator is in use. | |
| void | invt_allocation_set_stats_units (const size_t units) |
| Set the units to be used by default in invt_allocation_show_stats(). | |
Variables | |
| g_alloc_type | g_alloc |
| pthread_mutex_t | g_alloc_mutex = PTHREAD_MUTEX_INITIALIZER |
| size_t | g_stats_units = 0 |
|
|
Allocate nbytes of memory, throwing an exception in case of failure.
Definition at line 515 of file AllocAux.C. References g_alloc, g_alloc_mutex, and GVX_MUTEX_LOCK. Referenced by invt_allocate(). |
|
|
Turn on/off caching of memory blocks of commonly-used sizes.
Definition at line 533 of file AllocAux.C. References g_alloc, g_alloc_mutex, and GVX_MUTEX_LOCK. Referenced by ModelManager::paramChanged(). |
|
|
Turn on/off memory-allocation debugging statements. If on, each invt_allocate() and invt_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 Definition at line 539 of file AllocAux.C. References g_alloc, g_alloc_mutex, and GVX_MUTEX_LOCK. |
|
|
Released any cached free memory blocks (e.g. to conserve memory).
Definition at line 527 of file AllocAux.C. References g_alloc, g_alloc_mutex, and GVX_MUTEX_LOCK. Referenced by TrainingSet::load(), and TrainingSet::loadRebalanced(). |
|
|
Set the units to be used by default in invt_allocation_show_stats().
Definition at line 553 of file AllocAux.C. References g_stats_units. Referenced by InputFrameSeries::Impl::readFrame(). |
|
||||||||||||||||
|
Print current stats for whatever memory allocator is in use.
Definition at line 545 of file AllocAux.C. References g_alloc, g_alloc_mutex, g_stats_units, and GVX_MUTEX_LOCK. Referenced by submain(). |
|
|
Deallocate the given memory region.
Definition at line 521 of file AllocAux.C. References g_alloc, g_alloc_mutex, and GVX_MUTEX_LOCK. Referenced by invt_deallocate(). |
1.4.4