|
TBCI Numerical high perf. C++ Library
2.8.0
|
For specializations of the memory allocator: More...
#include <malloc_cache.h>
Public Member Functions | |
| int | find_by_sz (const unsigned ln) const |
| Find free slot with right len, starting point for search is free_idx. More... | |
| void | enter (const T *const ptr, const unsigned ln) |
| Enter into list of FREE slots. More... | |
| void | free_and_enter (const T *const ptr, const unsigned ln) |
| void | rmv (const unsigned idx) |
| Remove from list of FREE slots. More... | |
| 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 () |
| sizeof (tbci_memalloc_cache_tls< T >)*(num_threads+1)) | |
| init (0) | |
| if (nthr) | |
| thread_reg_callback ((cbackfn *)&_init,(cbackfn *)&_deinit,(void *) this) | |
| ~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 |
| __pad0__: nthr(num_threads) { malloc_tls = (tbci_memalloc_cache_tls<T>*) memalign(128 | |
For specializations of the memory allocator:
Definition at line 279 of file malloc_cache.h.
|
inline |
Definition at line 387 of file malloc_cache.h.
References tbci_memalloc_cache< T >::_deinit(), tbci_memalloc_cache< T >::_init(), tbci_memalloc_cache< T >::deinit(), tbci_memalloc_cache< T >::malloc_tls, tbci_memalloc_cache< T >::smp_deinit(), and thread_dereg_callback().
|
inlinestatic |
Definition at line 311 of file malloc_cache.h.
References tbci_memalloc_cache< T >::smp_deinit().
Referenced by tbci_memalloc_cache< T >::~tbci_memalloc_cache().
|
inlinestatic |
Definition at line 297 of file malloc_cache.h.
References tbci_memalloc_cache< T >::malloc_tls, tbci_memalloc_cache< T >::nthr, tbci_memalloc_cache< T >::smp_init(), and TBCI::SWAP().
Referenced by tbci_memalloc_cache< T >::~tbci_memalloc_cache().
|
inline |
We MAY be thread safe on x86 and x86-64, but not anywhere else
Definition at line 467 of file malloc_cache.h.
References _MC_NEW, BCHK, DEBUG_PRINTF3, ismainthread, T, TBCI_MALLOC_LIMIT, thrno, and UNLIKELY.
|
inline |
Definition at line 508 of file malloc_cache.h.
References _MC_DELETE, BCHK, CSTD__, ismainthread, T, TBCI_MALLOC_LIMIT, and UNLIKELY.
|
inline |
Definition at line 528 of file malloc_cache.h.
References _MC_DELETE, DEBUG_PRINTF1, DEBUG_PRINTF3, tbci_memalloc_cache_tls< T >::free_pt, tbci_memalloc_cache_tls< T >::free_sz, T, and TBCI_MALLOC_POOLSZ.
Referenced by tbci_memalloc_cache< T >::smp_deinit(), and tbci_memalloc_cache< T >::~tbci_memalloc_cache().
|
inline |
Enter into list of FREE slots.
Definition at line 433 of file malloc_cache.h.
References tbci_memalloc_cache_tls< T >::free_idx, tbci_memalloc_cache_tls< T >::free_pt, tbci_memalloc_cache_tls< T >::free_sz, TBCI_MALLOC_POOLSZ, and thrno.
|
inline |
Definition at line 452 of file malloc_cache.h.
References LIKELY, SMP_LOCK, SMP_UNLOCK, T, and thrno.
|
inline |
Find free slot with right len, starting point for search is free_idx.
Definition at line 402 of file malloc_cache.h.
References BCHK, DEBUG_PRINTF1, DEBUG_PRINTF2, tbci_memalloc_cache_tls< T >::free_idx, tbci_memalloc_cache_tls< T >::free_sz, tbci_memalloc_cache_tls< T >::hit, i, tbci_memalloc_cache_tls< T >::miss, small, tbci_memalloc_cache_tls< T >::srch, TBCI_MALLOC_POOLSZ, and thrno.
|
inline |
Definition at line 490 of file malloc_cache.h.
References _MC_DELETE, DEBUG_PRINTF4, tbci_memalloc_cache_tls< T >::free_idx, tbci_memalloc_cache_tls< T >::free_pt, tbci_memalloc_cache_tls< T >::free_sz, LIKELY, SMP_LOCK, SMP_UNLOCK, T, thrno, and UNLIKELY.
|
inline |
Definition at line 378 of file malloc_cache.h.
References tbci_memalloc_cache< T >::smp_init().
|
inline |
Definition at line 315 of file malloc_cache.h.
References BCHK, CSTD__, tbci_memalloc_cache_tls< T >::free_idx, tbci_memalloc_cache< T >::malloc_tls, tbci_memalloc_cache< T >::nthr, and TBCI_MALLOC_POOLSZ.
Referenced by tbci_memalloc_cache< T >::smp_init().
| tbci_memalloc_cache< T >::init | ( | 0 | ) |
|
inline |
Remove from list of FREE slots.
Definition at line 444 of file malloc_cache.h.
References tbci_memalloc_cache_tls< T >::free_idx, tbci_memalloc_cache_tls< T >::free_sz, and thrno.
| tbci_memalloc_cache< T >::sizeof | ( | tbci_memalloc_cache_tls< T > | ) |
|
inline |
Definition at line 337 of file malloc_cache.h.
References all, CSTD__, tbci_memalloc_cache< T >::deinit(), hit, tbci_memalloc_cache< T >::malloc_tls, miss, tbci_memalloc_cache< T >::nthr, srch, T, and thrno.
Referenced by tbci_memalloc_cache< T >::_deinit(), and tbci_memalloc_cache< T >::~tbci_memalloc_cache().
|
inline |
Definition at line 329 of file malloc_cache.h.
References tbci_memalloc_cache< T >::init(), and tbci_memalloc_cache< T >::nthr.
Referenced by tbci_memalloc_cache< T >::_init(), and tbci_memalloc_cache< T >::if().
| tbci_memalloc_cache< T >::thread_reg_callback | ( | (cbackfn *)& | _init, |
| (cbackfn *)& | _deinit, | ||
| (void *) | this | ||
| ) |
| tbci_memalloc_cache< T >::__pad0__ |
Definition at line 375 of file malloc_cache.h.
| tbci_memalloc_cache_tls<T>* tbci_memalloc_cache< T >::malloc_tls |
Definition at line 281 of file malloc_cache.h.
Referenced by tbci_memalloc_cache< T >::_init(), tbci_memalloc_cache< T >::init(), tbci_memalloc_cache< T >::smp_deinit(), and tbci_memalloc_cache< T >::~tbci_memalloc_cache().
| int tbci_memalloc_cache< T >::nthr |
Definition at line 286 of file malloc_cache.h.
Referenced by tbci_memalloc_cache< T >::_init(), tbci_memalloc_cache< T >::init(), tbci_memalloc_cache< T >::smp_deinit(), and tbci_memalloc_cache< T >::smp_init().
1.8.5