TBCI::tbci_memalloc_cache< T > Struct Template Reference

For specializations of the memory allocator: More...

#include <malloc_cache.h>

List of all members.

Public Member Functions

int find_by_sz (const unsigned ln) const
 Find free slot with right len, starting point for search is free_idx.
void enter (const T *const ptr, const unsigned ln)
 Enter into list of FREE slots.
void free_and_enter (const T *const ptr, const unsigned ln)
void rmv (const unsigned idx)
 Remove from list of FREE slots.
const T * find_and_rmv (const unsigned sz)
T * alloc (const unsigned long)
void dealloc (const T *const, const unsigned long)
void deinit (const int thr)
void init (const int thr)
void smp_init ()
void smp_deinit ()
 tbci_memalloc_cache ()
 ~tbci_memalloc_cache ()

Static Public Member Functions

static void _init (tbci_memalloc_cache< T > *th, const int thr)
static void _deinit (tbci_memalloc_cache< T > *th, const int thr)

Public Attributes

tbci_memalloc_cache_tls< T > * malloc_tls
int nthr


Detailed Description

template<typename T>
struct TBCI::tbci_memalloc_cache< T >

For specializations of the memory allocator:

Definition at line 273 of file malloc_cache.h.


Constructor & Destructor Documentation

template<typename T>
TBCI::tbci_memalloc_cache< T >::tbci_memalloc_cache (  )  [inline]

Definition at line 362 of file malloc_cache.h.

template<typename T>
TBCI::tbci_memalloc_cache< T >::~tbci_memalloc_cache (  )  [inline]

Definition at line 381 of file malloc_cache.h.


Member Function Documentation

template<typename T>
int TBCI::tbci_memalloc_cache< T >::find_by_sz ( const unsigned  ln  )  const [inline]

Find free slot with right len, starting point for search is free_idx.

Definition at line 396 of file malloc_cache.h.

References BCHK, DEBUG_PRINTF1, DEBUG_PRINTF2, TBCI::tbci_memalloc_cache< T >::malloc_tls, TBCI::tbci_memalloc_cache< T >::nthr, small, TBCI_MALLOC_POOLSZ, and TBCI::thrno.

Referenced by TBCI::tbci_memalloc_cache< T >::find_and_rmv().

template<typename T>
void TBCI::tbci_memalloc_cache< T >::enter ( const T *const   ptr,
const unsigned  ln 
) [inline]

Enter into list of FREE slots.

Definition at line 427 of file malloc_cache.h.

References TBCI::tbci_memalloc_cache< T >::malloc_tls, TBCI_MALLOC_POOLSZ, and TBCI::thrno.

Referenced by TBCI::tbci_memalloc_cache< T >::free_and_enter().

template<typename T>
void TBCI::tbci_memalloc_cache< T >::free_and_enter ( const T *const   ptr,
const unsigned  ln 
) [inline]

template<typename T>
void TBCI::tbci_memalloc_cache< T >::rmv ( const unsigned  idx  )  [inline]

Remove from list of FREE slots.

Definition at line 438 of file malloc_cache.h.

References TBCI::tbci_memalloc_cache< T >::malloc_tls, and TBCI::thrno.

Referenced by TBCI::tbci_memalloc_cache< T >::find_and_rmv().

template<typename T>
const T * TBCI::tbci_memalloc_cache< T >::find_and_rmv ( const unsigned  sz  )  [inline]

template<typename T>
T * TBCI::tbci_memalloc_cache< T >::alloc ( const unsigned long  sz  )  [inline]

We MAY be thread safe on x86 and x86-64, but not anywhere else

Definition at line 461 of file malloc_cache.h.

References _MC_NEW, BCHK, DEBUG_PRINTF3, TBCI::tbci_memalloc_cache< T >::find_and_rmv(), TBCI::ismainthread, TBCI::tbci_memalloc_cache< T >::malloc_tls, T, TBCI_MALLOC_LIMIT, TBCI::thrno, and UNLIKELY.

template<typename T>
void TBCI::tbci_memalloc_cache< T >::dealloc ( const T * const  ptr,
const unsigned long  sz 
) [inline]

template<typename T>
static void TBCI::tbci_memalloc_cache< T >::_init ( tbci_memalloc_cache< T > *  th,
const int  thr 
) [inline, static]

Definition at line 291 of file malloc_cache.h.

template<typename T>
static void TBCI::tbci_memalloc_cache< T >::_deinit ( tbci_memalloc_cache< T > *  th,
const int  thr 
) [inline, static]

Definition at line 305 of file malloc_cache.h.

template<typename T>
void TBCI::tbci_memalloc_cache< T >::deinit ( const int  thr  )  [inline]

template<typename T>
void TBCI::tbci_memalloc_cache< T >::init ( const int  thr  )  [inline]

Definition at line 309 of file malloc_cache.h.

template<typename T>
void TBCI::tbci_memalloc_cache< T >::smp_init (  )  [inline]

Definition at line 323 of file malloc_cache.h.

Referenced by TBCI::tbci_memalloc_cache< floatptr >::_init().

template<typename T>
void TBCI::tbci_memalloc_cache< T >::smp_deinit (  )  [inline]

Definition at line 331 of file malloc_cache.h.

Referenced by TBCI::tbci_memalloc_cache< floatptr >::_deinit().


Member Data Documentation

template<typename T>
int TBCI::tbci_memalloc_cache< T >::nthr


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

Generated on Wed Nov 20 09:29:35 2013 for TBCI Numerical high perf. C++ Library by  doxygen 1.5.6