Blame jemalloc/include/jemalloc/internal/tcache_externs.h

Packit 345191
#ifndef JEMALLOC_INTERNAL_TCACHE_EXTERNS_H
Packit 345191
#define JEMALLOC_INTERNAL_TCACHE_EXTERNS_H
Packit 345191
Packit 345191
extern bool	opt_tcache;
Packit 345191
extern ssize_t	opt_lg_tcache_max;
Packit 345191
Packit 345191
extern cache_bin_info_t	*tcache_bin_info;
Packit 345191
Packit 345191
/*
Packit 345191
 * Number of tcache bins.  There are SC_NBINS small-object bins, plus 0 or more
Packit 345191
 * large-object bins.
Packit 345191
 */
Packit 345191
extern unsigned	nhbins;
Packit 345191
Packit 345191
/* Maximum cached size class. */
Packit 345191
extern size_t	tcache_maxclass;
Packit 345191
Packit 345191
/*
Packit 345191
 * Explicit tcaches, managed via the tcache.{create,flush,destroy} mallctls and
Packit 345191
 * usable via the MALLOCX_TCACHE() flag.  The automatic per thread tcaches are
Packit 345191
 * completely disjoint from this data structure.  tcaches starts off as a sparse
Packit 345191
 * array, so it has no physical memory footprint until individual pages are
Packit 345191
 * touched.  This allows the entire array to be allocated the first time an
Packit 345191
 * explicit tcache is created without a disproportionate impact on memory usage.
Packit 345191
 */
Packit 345191
extern tcaches_t	*tcaches;
Packit 345191
Packit 345191
size_t	tcache_salloc(tsdn_t *tsdn, const void *ptr);
Packit 345191
void	tcache_event_hard(tsd_t *tsd, tcache_t *tcache);
Packit 345191
void	*tcache_alloc_small_hard(tsdn_t *tsdn, arena_t *arena, tcache_t *tcache,
Packit 345191
    cache_bin_t *tbin, szind_t binind, bool *tcache_success);
Packit 345191
void	tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, cache_bin_t *tbin,
Packit 345191
    szind_t binind, unsigned rem);
Packit 345191
void	tcache_bin_flush_large(tsd_t *tsd, cache_bin_t *tbin, szind_t binind,
Packit 345191
    unsigned rem, tcache_t *tcache);
Packit 345191
void	tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache,
Packit 345191
    arena_t *arena);
Packit 345191
tcache_t *tcache_create_explicit(tsd_t *tsd);
Packit 345191
void	tcache_cleanup(tsd_t *tsd);
Packit 345191
void	tcache_stats_merge(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena);
Packit 345191
bool	tcaches_create(tsd_t *tsd, unsigned *r_ind);
Packit 345191
void	tcaches_flush(tsd_t *tsd, unsigned ind);
Packit 345191
void	tcaches_destroy(tsd_t *tsd, unsigned ind);
Packit 345191
bool	tcache_boot(tsdn_t *tsdn);
Packit 345191
void tcache_arena_associate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena);
Packit 345191
void tcache_prefork(tsdn_t *tsdn);
Packit 345191
void tcache_postfork_parent(tsdn_t *tsdn);
Packit 345191
void tcache_postfork_child(tsdn_t *tsdn);
Packit 345191
void tcache_flush(tsd_t *tsd);
Packit 345191
bool tsd_tcache_data_init(tsd_t *tsd);
Packit 345191
bool tsd_tcache_enabled_data_init(tsd_t *tsd);
Packit 345191
Packit 345191
#endif /* JEMALLOC_INTERNAL_TCACHE_EXTERNS_H */