Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/jemalloc/include/jemalloc/internal/arena_structs_b.h
#ifndef JEMALLOC_INTERNAL_ARENA_STRUCTS_B_H | #ifndef JEMALLOC_INTERNAL_ARENA_STRUCTS_B_H | ||||
#define JEMALLOC_INTERNAL_ARENA_STRUCTS_B_H | #define JEMALLOC_INTERNAL_ARENA_STRUCTS_B_H | ||||
#include "jemalloc/internal/arena_stats.h" | #include "jemalloc/internal/arena_stats.h" | ||||
#include "jemalloc/internal/atomic.h" | #include "jemalloc/internal/atomic.h" | ||||
#include "jemalloc/internal/bin.h" | #include "jemalloc/internal/bin.h" | ||||
#include "jemalloc/internal/bitmap.h" | #include "jemalloc/internal/bitmap.h" | ||||
#include "jemalloc/internal/extent_dss.h" | #include "jemalloc/internal/extent_dss.h" | ||||
#include "jemalloc/internal/jemalloc_internal_types.h" | #include "jemalloc/internal/jemalloc_internal_types.h" | ||||
#include "jemalloc/internal/mutex.h" | #include "jemalloc/internal/mutex.h" | ||||
#include "jemalloc/internal/nstime.h" | #include "jemalloc/internal/nstime.h" | ||||
#include "jemalloc/internal/ql.h" | #include "jemalloc/internal/ql.h" | ||||
#include "jemalloc/internal/size_classes.h" | #include "jemalloc/internal/sc.h" | ||||
#include "jemalloc/internal/smoothstep.h" | #include "jemalloc/internal/smoothstep.h" | ||||
#include "jemalloc/internal/ticker.h" | #include "jemalloc/internal/ticker.h" | ||||
struct arena_decay_s { | struct arena_decay_s { | ||||
/* Synchronizes all non-atomic fields. */ | /* Synchronizes all non-atomic fields. */ | ||||
malloc_mutex_t mtx; | malloc_mutex_t mtx; | ||||
/* | /* | ||||
* True if a thread is currently purging the extents associated with | * True if a thread is currently purging the extents associated with | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | struct arena_s { | ||||
* | * | ||||
* 0: Application allocation. | * 0: Application allocation. | ||||
* 1: Internal metadata allocation. | * 1: Internal metadata allocation. | ||||
* | * | ||||
* Synchronization: atomic. | * Synchronization: atomic. | ||||
*/ | */ | ||||
atomic_u_t nthreads[2]; | atomic_u_t nthreads[2]; | ||||
/* Next bin shard for binding new threads. Synchronization: atomic. */ | |||||
atomic_u_t binshard_next; | |||||
/* | /* | ||||
* When percpu_arena is enabled, to amortize the cost of reading / | * When percpu_arena is enabled, to amortize the cost of reading / | ||||
* updating the current CPU id, track the most recent thread accessing | * updating the current CPU id, track the most recent thread accessing | ||||
* this arena, and only read CPU if there is a mismatch. | * this arena, and only read CPU if there is a mismatch. | ||||
*/ | */ | ||||
tsdn_t *last_thd; | tsdn_t *last_thd; | ||||
/* Synchronization: internal. */ | /* Synchronization: internal. */ | ||||
arena_stats_t stats; | arena_stats_t stats; | ||||
/* | /* | ||||
* Lists of tcaches and cache_bin_array_descriptors for extant threads | * Lists of tcaches and cache_bin_array_descriptors for extant threads | ||||
* associated with this arena. Stats from these are merged | * associated with this arena. Stats from these are merged | ||||
* incrementally, and at exit if opt_stats_print is enabled. | * incrementally, and at exit if opt_stats_print is enabled. | ||||
* | * | ||||
* Synchronization: tcache_ql_mtx. | * Synchronization: tcache_ql_mtx. | ||||
*/ | */ | ||||
ql_head(tcache_t) tcache_ql; | ql_head(tcache_t) tcache_ql; | ||||
ql_head(cache_bin_array_descriptor_t) cache_bin_array_descriptor_ql; | ql_head(cache_bin_array_descriptor_t) cache_bin_array_descriptor_ql; | ||||
malloc_mutex_t tcache_ql_mtx; | malloc_mutex_t tcache_ql_mtx; | ||||
/* Synchronization: internal. */ | /* Synchronization: internal. */ | ||||
prof_accum_t prof_accum; | prof_accum_t prof_accum; | ||||
uint64_t prof_accumbytes; | |||||
/* | /* | ||||
* PRNG state for cache index randomization of large allocation base | * PRNG state for cache index randomization of large allocation base | ||||
* pointers. | * pointers. | ||||
* | * | ||||
* Synchronization: atomic. | * Synchronization: atomic. | ||||
*/ | */ | ||||
atomic_zu_t offset_state; | atomic_zu_t offset_state; | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | struct arena_s { | ||||
/* | /* | ||||
* Available extent structures that were allocated via | * Available extent structures that were allocated via | ||||
* base_alloc_extent(). | * base_alloc_extent(). | ||||
* | * | ||||
* Synchronization: extent_avail_mtx. | * Synchronization: extent_avail_mtx. | ||||
*/ | */ | ||||
extent_tree_t extent_avail; | extent_tree_t extent_avail; | ||||
atomic_zu_t extent_avail_cnt; | |||||
malloc_mutex_t extent_avail_mtx; | malloc_mutex_t extent_avail_mtx; | ||||
/* | /* | ||||
* bins is used to store heaps of free regions. | * bins is used to store heaps of free regions. | ||||
* | * | ||||
* Synchronization: internal. | * Synchronization: internal. | ||||
*/ | */ | ||||
bin_t bins[NBINS]; | bins_t bins[SC_NBINS]; | ||||
/* | /* | ||||
* Base allocator, from which arena metadata are allocated. | * Base allocator, from which arena metadata are allocated. | ||||
* | * | ||||
* Synchronization: internal. | * Synchronization: internal. | ||||
*/ | */ | ||||
base_t *base; | base_t *base; | ||||
/* Used to determine uptime. Read-only after initialization. */ | /* Used to determine uptime. Read-only after initialization. */ | ||||
Show All 15 Lines |