|
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. | |
| 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 |
For specializations of the memory allocator:
Definition at line 279 of file malloc_cache.h.
|
inline |
Definition at line 368 of file malloc_cache.h.
References _deinit(), _init(), init(), malloc_tls, nthr, num_threads, smp_init(), and thread_reg_callback().
|
inline |
Definition at line 387 of file malloc_cache.h.
References _deinit(), _init(), deinit(), malloc_tls, smp_deinit(), and thread_dereg_callback().
|
inlinestatic |
Definition at line 311 of file malloc_cache.h.
References smp_deinit(), and tbci_memalloc_cache().
Referenced by tbci_memalloc_cache(), and ~tbci_memalloc_cache().
|
inlinestatic |
Definition at line 297 of file malloc_cache.h.
References malloc_tls, nthr, smp_init(), and tbci_memalloc_cache().
Referenced by tbci_memalloc_cache(), and ~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, alloc(), BCHK, DEBUG_PRINTF3, find_and_rmv(), ismainthread, malloc_tls, T, TBCI_MALLOC_LIMIT, thrno, and UNLIKELY.
Referenced by alloc().
|
inline |
Definition at line 508 of file malloc_cache.h.
References _MC_DELETE, BCHK, CSTD__, dealloc(), free_and_enter(), ismainthread, T, TBCI_MALLOC_LIMIT, and UNLIKELY.
Referenced by dealloc().
|
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, malloc_tls, T, and TBCI_MALLOC_POOLSZ.
Referenced by smp_deinit(), and ~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, malloc_tls, T, TBCI_MALLOC_POOLSZ, and thrno.
Referenced by free_and_enter().
|
inline |
Definition at line 452 of file malloc_cache.h.
References find_by_sz(), LIKELY, malloc_tls, rmv(), SMP_LOCK, SMP_UNLOCK, T, and thrno.
Referenced by alloc().
|
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, malloc_tls, tbci_memalloc_cache_tls< T >::miss, nthr, small, tbci_memalloc_cache_tls< T >::srch, TBCI_MALLOC_POOLSZ, and thrno.
Referenced by find_and_rmv().
|
inline |
Definition at line 490 of file malloc_cache.h.
References _MC_DELETE, DEBUG_PRINTF4, enter(), tbci_memalloc_cache_tls< T >::free_idx, tbci_memalloc_cache_tls< T >::free_pt, tbci_memalloc_cache_tls< T >::free_sz, LIKELY, malloc_tls, SMP_LOCK, SMP_UNLOCK, T, thrno, and UNLIKELY.
Referenced by dealloc().
|
inline |
Definition at line 315 of file malloc_cache.h.
References BCHK, CSTD__, tbci_memalloc_cache_tls< T >::free_idx, malloc_tls, nthr, and TBCI_MALLOC_POOLSZ.
Referenced by smp_init(), and tbci_memalloc_cache().
|
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, malloc_tls, and thrno.
Referenced by find_and_rmv().
|
inline |
Definition at line 337 of file malloc_cache.h.
References all, CSTD__, deinit(), hit, malloc_tls, miss, nthr, srch, T, and thrno.
Referenced by _deinit(), and ~tbci_memalloc_cache().
|
inline |
Definition at line 329 of file malloc_cache.h.
Referenced by _init(), and tbci_memalloc_cache().
| tbci_memalloc_cache_tls<T>* tbci_memalloc_cache< T >::malloc_tls |
Definition at line 281 of file malloc_cache.h.
Referenced by _init(), alloc(), deinit(), enter(), find_and_rmv(), find_by_sz(), free_and_enter(), init(), rmv(), smp_deinit(), tbci_memalloc_cache(), and ~tbci_memalloc_cache().
| int tbci_memalloc_cache< T >::nthr |
Definition at line 286 of file malloc_cache.h.
Referenced by _init(), find_by_sz(), init(), smp_deinit(), smp_init(), and tbci_memalloc_cache().