mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 22:03:07 +00:00
Consolidate arena_* header split into arena.h
arena_types.h + arena_structs.h + arena_externs.h merged into arena.h, keeping the three logical sections (TYPES / STRUCTS / EXTERNS) with explicit dividers. arena_inlines_a.h and arena_inlines_b.h stay separate; arena_inlines_b.h now carries a comment explaining why merging the two would reintroduce a real #include cycle through tcache_inlines.h -> arena_choose (the asymmetric cycle-breaker). arena_decay_constants.h (new): minimal header for ARENA_DECAY_NTICKS_PER_UPDATE.
This commit is contained in:
@@ -1,14 +1,181 @@
|
|||||||
#ifndef JEMALLOC_INTERNAL_ARENA_EXTERNS_H
|
#ifndef JEMALLOC_INTERNAL_ARENA_H
|
||||||
#define JEMALLOC_INTERNAL_ARENA_EXTERNS_H
|
#define JEMALLOC_INTERNAL_ARENA_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
|
#include "jemalloc/internal/arena_decay_constants.h"
|
||||||
#include "jemalloc/internal/arena_stats.h"
|
#include "jemalloc/internal/arena_stats.h"
|
||||||
|
#include "jemalloc/internal/atomic.h"
|
||||||
#include "jemalloc/internal/bin.h"
|
#include "jemalloc/internal/bin.h"
|
||||||
|
#include "jemalloc/internal/bitmap.h"
|
||||||
|
#include "jemalloc/internal/counter.h"
|
||||||
#include "jemalloc/internal/div.h"
|
#include "jemalloc/internal/div.h"
|
||||||
|
#include "jemalloc/internal/ecache.h"
|
||||||
|
#include "jemalloc/internal/edata_cache.h"
|
||||||
#include "jemalloc/internal/emap.h"
|
#include "jemalloc/internal/emap.h"
|
||||||
#include "jemalloc/internal/extent_dss.h"
|
#include "jemalloc/internal/extent_dss.h"
|
||||||
|
#include "jemalloc/internal/jemalloc_internal_types.h"
|
||||||
|
#include "jemalloc/internal/mutex.h"
|
||||||
|
#include "jemalloc/internal/nstime.h"
|
||||||
|
#include "jemalloc/internal/pa.h"
|
||||||
#include "jemalloc/internal/pages.h"
|
#include "jemalloc/internal/pages.h"
|
||||||
|
#include "jemalloc/internal/ql.h"
|
||||||
|
#include "jemalloc/internal/sc.h"
|
||||||
#include "jemalloc/internal/stats.h"
|
#include "jemalloc/internal/stats.h"
|
||||||
|
#include "jemalloc/internal/ticker.h"
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* TYPES */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Default decay times in milliseconds. */
|
||||||
|
#define DIRTY_DECAY_MS_DEFAULT ZD(10 * 1000)
|
||||||
|
#define MUZZY_DECAY_MS_DEFAULT (0)
|
||||||
|
/* Maximum length of the arena name. */
|
||||||
|
#define ARENA_NAME_LEN 32
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
percpu_arena_mode_names_base = 0, /* Used for options processing. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* *_uninit are used only during bootstrapping, and must correspond
|
||||||
|
* to initialized variant plus percpu_arena_mode_enabled_base.
|
||||||
|
*/
|
||||||
|
percpu_arena_uninit = 0,
|
||||||
|
per_phycpu_arena_uninit = 1,
|
||||||
|
|
||||||
|
/* All non-disabled modes must come after percpu_arena_disabled. */
|
||||||
|
percpu_arena_disabled = 2,
|
||||||
|
|
||||||
|
percpu_arena_mode_names_limit = 3, /* Used for options processing. */
|
||||||
|
percpu_arena_mode_enabled_base = 3,
|
||||||
|
|
||||||
|
percpu_arena = 3,
|
||||||
|
per_phycpu_arena = 4 /* Hyper threads share arena. */
|
||||||
|
} percpu_arena_mode_t;
|
||||||
|
|
||||||
|
#define PERCPU_ARENA_ENABLED(m) ((m) >= percpu_arena_mode_enabled_base)
|
||||||
|
#define PERCPU_ARENA_DEFAULT percpu_arena_disabled
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When allocation_size >= oversize_threshold, use the dedicated huge arena
|
||||||
|
* (unless have explicitly spicified arena index). 0 disables the feature.
|
||||||
|
*/
|
||||||
|
#define OVERSIZE_THRESHOLD_DEFAULT (8 << 20)
|
||||||
|
|
||||||
|
struct arena_config_s {
|
||||||
|
/* extent hooks to be used for the arena */
|
||||||
|
extent_hooks_t *extent_hooks;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use extent hooks for metadata (base) allocations when true.
|
||||||
|
*/
|
||||||
|
bool metadata_use_hooks;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct arena_config_s arena_config_t;
|
||||||
|
|
||||||
|
extern const arena_config_t arena_config_default;
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* STRUCTS */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
struct arena_s {
|
||||||
|
/*
|
||||||
|
* Number of threads currently assigned to this arena. Each thread has
|
||||||
|
* two distinct assignments, one for application-serving allocation, and
|
||||||
|
* the other for internal metadata allocation. Internal metadata must
|
||||||
|
* not be allocated from arenas explicitly created via the arenas.create
|
||||||
|
* mallctl, because the arena.<i>.reset mallctl indiscriminately
|
||||||
|
* discards all allocations for the affected arena.
|
||||||
|
*
|
||||||
|
* 0: Application allocation.
|
||||||
|
* 1: Internal metadata allocation.
|
||||||
|
*
|
||||||
|
* Synchronization: atomic.
|
||||||
|
*/
|
||||||
|
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 /
|
||||||
|
* updating the current CPU id, track the most recent thread accessing
|
||||||
|
* this arena, and only read CPU if there is a mismatch.
|
||||||
|
*/
|
||||||
|
tsdn_t *last_thd;
|
||||||
|
|
||||||
|
/* Synchronization: internal. */
|
||||||
|
arena_stats_t stats;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* List of cache_bin_array_descriptors for extant threads associated
|
||||||
|
* with this arena. Stats from these are merged incrementally, and at
|
||||||
|
* exit if opt_stats_print is enabled.
|
||||||
|
*
|
||||||
|
* Synchronization: cache_bin_array_descriptor_ql_mtx.
|
||||||
|
*/
|
||||||
|
ql_head(cache_bin_array_descriptor_t) cache_bin_array_descriptor_ql;
|
||||||
|
malloc_mutex_t cache_bin_array_descriptor_ql_mtx;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Represents a dss_prec_t, but atomically.
|
||||||
|
*
|
||||||
|
* Synchronization: atomic.
|
||||||
|
*/
|
||||||
|
atomic_u_t dss_prec;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Extant large allocations.
|
||||||
|
*
|
||||||
|
* Synchronization: large_mtx.
|
||||||
|
*/
|
||||||
|
edata_list_active_t large;
|
||||||
|
/* Synchronizes all large allocation/update/deallocation. */
|
||||||
|
malloc_mutex_t large_mtx;
|
||||||
|
|
||||||
|
/* The page-level allocator shard this arena uses. */
|
||||||
|
pa_shard_t pa_shard;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A cached copy of base->ind. This can get accessed on hot paths;
|
||||||
|
* looking it up in base requires an extra pointer hop / cache miss.
|
||||||
|
*/
|
||||||
|
unsigned ind;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Base allocator, from which arena metadata are allocated.
|
||||||
|
*
|
||||||
|
* Synchronization: internal.
|
||||||
|
*/
|
||||||
|
base_t *base;
|
||||||
|
/* Used to determine uptime. Read-only after initialization. */
|
||||||
|
nstime_t create_time;
|
||||||
|
|
||||||
|
/* The name of the arena. */
|
||||||
|
char name[ARENA_NAME_LEN];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The arena is allocated alongside its bins; really this is a
|
||||||
|
* dynamically sized array determined by the binshard settings.
|
||||||
|
* Enforcing cacheline-alignment to minimize the number of cachelines
|
||||||
|
* touched on the hot paths.
|
||||||
|
*/
|
||||||
|
JEMALLOC_WARN_ON_USAGE(
|
||||||
|
"Do not use this field directly. "
|
||||||
|
"Use `arena_get_bin` instead.")
|
||||||
|
JEMALLOC_ALIGNED(CACHELINE)
|
||||||
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
|
bin_t all_bins[];
|
||||||
|
#else
|
||||||
|
bin_t all_bins[0];
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* EXTERNS */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When the amount of pages to be purged exceeds this amount, deferred purge
|
* When the amount of pages to be purged exceeds this amount, deferred purge
|
||||||
@@ -123,4 +290,4 @@ void arena_postfork_parent(tsdn_t *tsdn, arena_t *arena);
|
|||||||
void arena_postfork_child(tsdn_t *tsdn, arena_t *arena,
|
void arena_postfork_child(tsdn_t *tsdn, arena_t *arena,
|
||||||
cache_bin_array_descriptor_t *surviving_desc);
|
cache_bin_array_descriptor_t *surviving_desc);
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_ARENA_EXTERNS_H */
|
#endif /* JEMALLOC_INTERNAL_ARENA_H */
|
||||||
13
include/jemalloc/internal/arena_decay_constants.h
Normal file
13
include/jemalloc/internal/arena_decay_constants.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef JEMALLOC_INTERNAL_ARENA_DECAY_CONSTANTS_H
|
||||||
|
#define JEMALLOC_INTERNAL_ARENA_DECAY_CONSTANTS_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Minimal header so both arena.h and tsd_internals.h can share decay-related
|
||||||
|
* constants without dragging the full arena types into the tsd parse chain
|
||||||
|
* (which is loaded long before arena.h via ckh.h -> tsd.h).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Number of event ticks between time checks. */
|
||||||
|
#define ARENA_DECAY_NTICKS_PER_UPDATE 1000
|
||||||
|
|
||||||
|
#endif /* JEMALLOC_INTERNAL_ARENA_DECAY_CONSTANTS_H */
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#define JEMALLOC_INTERNAL_ARENA_INLINES_A_H
|
#define JEMALLOC_INTERNAL_ARENA_INLINES_A_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_structs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
|
|
||||||
static inline unsigned
|
static inline unsigned
|
||||||
arena_ind_get(const arena_t *arena) {
|
arena_ind_get(const arena_t *arena) {
|
||||||
|
|||||||
@@ -1,9 +1,27 @@
|
|||||||
#ifndef JEMALLOC_INTERNAL_ARENA_INLINES_B_H
|
#ifndef JEMALLOC_INTERNAL_ARENA_INLINES_B_H
|
||||||
#define JEMALLOC_INTERNAL_ARENA_INLINES_B_H
|
#define JEMALLOC_INTERNAL_ARENA_INLINES_B_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This split (arena_inlines_a.h + arena_inlines_b.h) is load-bearing, not
|
||||||
|
* stylistic. arena_inlines_a.h holds the cheap field accessors that only
|
||||||
|
* depend on arena.h fields. This file holds the larger inlines that depend
|
||||||
|
* on arena_choose(), prof, large, and friends.
|
||||||
|
*
|
||||||
|
* Merging the two would create a real #include cycle through arena_choose():
|
||||||
|
* jemalloc_internal_inlines_b.h defines arena_choose() and pulls in
|
||||||
|
* arena_inlines_a.h at the top for the cheap accessors. arena_choose() is
|
||||||
|
* called from arena_choose_maybe_huge() in this file. If that #include
|
||||||
|
* resolved to a merged "arena_inlines.h", arena_choose_maybe_huge() would
|
||||||
|
* be parsed before arena_choose() exists, and we would get an implicit
|
||||||
|
* declaration error -- arena_inlines.h cannot pull in
|
||||||
|
* jemalloc_internal_inlines_b.h to fix it (that file is mid-parse and its
|
||||||
|
* include guard is already set).
|
||||||
|
*
|
||||||
|
* Keep this file separate from arena_inlines_a.h.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_externs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/arena_structs.h"
|
|
||||||
#include "jemalloc/internal/bin_inlines.h"
|
#include "jemalloc/internal/bin_inlines.h"
|
||||||
#include "jemalloc/internal/div.h"
|
#include "jemalloc/internal/div.h"
|
||||||
#include "jemalloc/internal/emap.h"
|
#include "jemalloc/internal/emap.h"
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
#ifndef JEMALLOC_INTERNAL_ARENA_STRUCTS_H
|
|
||||||
#define JEMALLOC_INTERNAL_ARENA_STRUCTS_H
|
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
|
||||||
#include "jemalloc/internal/arena_stats.h"
|
|
||||||
#include "jemalloc/internal/atomic.h"
|
|
||||||
#include "jemalloc/internal/bin.h"
|
|
||||||
#include "jemalloc/internal/bitmap.h"
|
|
||||||
#include "jemalloc/internal/counter.h"
|
|
||||||
#include "jemalloc/internal/ecache.h"
|
|
||||||
#include "jemalloc/internal/edata_cache.h"
|
|
||||||
#include "jemalloc/internal/extent_dss.h"
|
|
||||||
#include "jemalloc/internal/jemalloc_internal_types.h"
|
|
||||||
#include "jemalloc/internal/mutex.h"
|
|
||||||
#include "jemalloc/internal/nstime.h"
|
|
||||||
#include "jemalloc/internal/pa.h"
|
|
||||||
#include "jemalloc/internal/ql.h"
|
|
||||||
#include "jemalloc/internal/sc.h"
|
|
||||||
#include "jemalloc/internal/ticker.h"
|
|
||||||
|
|
||||||
struct arena_s {
|
|
||||||
/*
|
|
||||||
* Number of threads currently assigned to this arena. Each thread has
|
|
||||||
* two distinct assignments, one for application-serving allocation, and
|
|
||||||
* the other for internal metadata allocation. Internal metadata must
|
|
||||||
* not be allocated from arenas explicitly created via the arenas.create
|
|
||||||
* mallctl, because the arena.<i>.reset mallctl indiscriminately
|
|
||||||
* discards all allocations for the affected arena.
|
|
||||||
*
|
|
||||||
* 0: Application allocation.
|
|
||||||
* 1: Internal metadata allocation.
|
|
||||||
*
|
|
||||||
* Synchronization: atomic.
|
|
||||||
*/
|
|
||||||
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 /
|
|
||||||
* updating the current CPU id, track the most recent thread accessing
|
|
||||||
* this arena, and only read CPU if there is a mismatch.
|
|
||||||
*/
|
|
||||||
tsdn_t *last_thd;
|
|
||||||
|
|
||||||
/* Synchronization: internal. */
|
|
||||||
arena_stats_t stats;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of cache_bin_array_descriptors for extant threads associated
|
|
||||||
* with this arena. Stats from these are merged incrementally, and at
|
|
||||||
* exit if opt_stats_print is enabled.
|
|
||||||
*
|
|
||||||
* Synchronization: cache_bin_array_descriptor_ql_mtx.
|
|
||||||
*/
|
|
||||||
ql_head(cache_bin_array_descriptor_t) cache_bin_array_descriptor_ql;
|
|
||||||
malloc_mutex_t cache_bin_array_descriptor_ql_mtx;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Represents a dss_prec_t, but atomically.
|
|
||||||
*
|
|
||||||
* Synchronization: atomic.
|
|
||||||
*/
|
|
||||||
atomic_u_t dss_prec;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Extant large allocations.
|
|
||||||
*
|
|
||||||
* Synchronization: large_mtx.
|
|
||||||
*/
|
|
||||||
edata_list_active_t large;
|
|
||||||
/* Synchronizes all large allocation/update/deallocation. */
|
|
||||||
malloc_mutex_t large_mtx;
|
|
||||||
|
|
||||||
/* The page-level allocator shard this arena uses. */
|
|
||||||
pa_shard_t pa_shard;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A cached copy of base->ind. This can get accessed on hot paths;
|
|
||||||
* looking it up in base requires an extra pointer hop / cache miss.
|
|
||||||
*/
|
|
||||||
unsigned ind;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Base allocator, from which arena metadata are allocated.
|
|
||||||
*
|
|
||||||
* Synchronization: internal.
|
|
||||||
*/
|
|
||||||
base_t *base;
|
|
||||||
/* Used to determine uptime. Read-only after initialization. */
|
|
||||||
nstime_t create_time;
|
|
||||||
|
|
||||||
/* The name of the arena. */
|
|
||||||
char name[ARENA_NAME_LEN];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The arena is allocated alongside its bins; really this is a
|
|
||||||
* dynamically sized array determined by the binshard settings.
|
|
||||||
* Enforcing cacheline-alignment to minimize the number of cachelines
|
|
||||||
* touched on the hot paths.
|
|
||||||
*/
|
|
||||||
JEMALLOC_WARN_ON_USAGE(
|
|
||||||
"Do not use this field directly. "
|
|
||||||
"Use `arena_get_bin` instead.")
|
|
||||||
JEMALLOC_ALIGNED(CACHELINE)
|
|
||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
||||||
bin_t all_bins[];
|
|
||||||
#else
|
|
||||||
bin_t all_bins[0];
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_ARENA_STRUCTS_H */
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
#ifndef JEMALLOC_INTERNAL_ARENA_TYPES_H
|
|
||||||
#define JEMALLOC_INTERNAL_ARENA_TYPES_H
|
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
|
||||||
#include "jemalloc/internal/sc.h"
|
|
||||||
|
|
||||||
/* Default decay times in milliseconds. */
|
|
||||||
#define DIRTY_DECAY_MS_DEFAULT ZD(10 * 1000)
|
|
||||||
#define MUZZY_DECAY_MS_DEFAULT (0)
|
|
||||||
/* Number of event ticks between time checks. */
|
|
||||||
#define ARENA_DECAY_NTICKS_PER_UPDATE 1000
|
|
||||||
/* Maximum length of the arena name. */
|
|
||||||
#define ARENA_NAME_LEN 32
|
|
||||||
|
|
||||||
typedef struct arena_s arena_t;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
percpu_arena_mode_names_base = 0, /* Used for options processing. */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* *_uninit are used only during bootstrapping, and must correspond
|
|
||||||
* to initialized variant plus percpu_arena_mode_enabled_base.
|
|
||||||
*/
|
|
||||||
percpu_arena_uninit = 0,
|
|
||||||
per_phycpu_arena_uninit = 1,
|
|
||||||
|
|
||||||
/* All non-disabled modes must come after percpu_arena_disabled. */
|
|
||||||
percpu_arena_disabled = 2,
|
|
||||||
|
|
||||||
percpu_arena_mode_names_limit = 3, /* Used for options processing. */
|
|
||||||
percpu_arena_mode_enabled_base = 3,
|
|
||||||
|
|
||||||
percpu_arena = 3,
|
|
||||||
per_phycpu_arena = 4 /* Hyper threads share arena. */
|
|
||||||
} percpu_arena_mode_t;
|
|
||||||
|
|
||||||
#define PERCPU_ARENA_ENABLED(m) ((m) >= percpu_arena_mode_enabled_base)
|
|
||||||
#define PERCPU_ARENA_DEFAULT percpu_arena_disabled
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When allocation_size >= oversize_threshold, use the dedicated huge arena
|
|
||||||
* (unless have explicitly spicified arena index). 0 disables the feature.
|
|
||||||
*/
|
|
||||||
#define OVERSIZE_THRESHOLD_DEFAULT (8 << 20)
|
|
||||||
|
|
||||||
struct arena_config_s {
|
|
||||||
/* extent hooks to be used for the arena */
|
|
||||||
extent_hooks_t *extent_hooks;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Use extent hooks for metadata (base) allocations when true.
|
|
||||||
*/
|
|
||||||
bool metadata_use_hooks;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct arena_config_s arena_config_t;
|
|
||||||
|
|
||||||
extern const arena_config_t arena_config_default;
|
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_ARENA_TYPES_H */
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef JEMALLOC_INTERNAL_ARENAS_MANAGEMENT_H
|
#ifndef JEMALLOC_INTERNAL_ARENAS_MANAGEMENT_H
|
||||||
#define JEMALLOC_INTERNAL_ARENAS_MANAGEMENT_H
|
#define JEMALLOC_INTERNAL_ARENAS_MANAGEMENT_H
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_types.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/atomic.h"
|
#include "jemalloc/internal/atomic.h"
|
||||||
#include "jemalloc/internal/tsd_types.h"
|
#include "jemalloc/internal/tsd_types.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
#define JEMALLOC_INTERNAL_EXTENT_DSS_H
|
#define JEMALLOC_INTERNAL_EXTENT_DSS_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_types.h"
|
|
||||||
#include "jemalloc/internal/tsd_types.h"
|
#include "jemalloc/internal/tsd_types.h"
|
||||||
|
|
||||||
|
/* Forward decl; arena.h includes us, so we can't include arena.h back. */
|
||||||
|
typedef struct arena_s arena_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
dss_prec_disabled = 0,
|
dss_prec_disabled = 0,
|
||||||
dss_prec_primary = 1,
|
dss_prec_primary = 1,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef JEMALLOC_INTERNAL_EXTERNS_H
|
#ifndef JEMALLOC_INTERNAL_EXTERNS_H
|
||||||
#define JEMALLOC_INTERNAL_EXTERNS_H
|
#define JEMALLOC_INTERNAL_EXTERNS_H
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_types.h"
|
|
||||||
#include "jemalloc/internal/atomic.h"
|
#include "jemalloc/internal/atomic.h"
|
||||||
#include "jemalloc/internal/fxp.h"
|
#include "jemalloc/internal/fxp.h"
|
||||||
#include "jemalloc/internal/hpa_opts.h"
|
#include "jemalloc/internal/hpa_opts.h"
|
||||||
|
|||||||
@@ -36,24 +36,13 @@
|
|||||||
* global jemalloc definitions, however.
|
* global jemalloc definitions, however.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/******************************************************************************/
|
#include "jemalloc/internal/arena.h"
|
||||||
/* TYPES */
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_types.h"
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
/* STRUCTS */
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_structs.h"
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* EXTERNS */
|
/* EXTERNS */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_internal_externs.h"
|
#include "jemalloc/internal/jemalloc_internal_externs.h"
|
||||||
#include "jemalloc/internal/arena_externs.h"
|
|
||||||
#include "jemalloc/internal/large.h"
|
#include "jemalloc/internal/large.h"
|
||||||
#include "jemalloc/internal/tcache.h"
|
#include "jemalloc/internal/tcache.h"
|
||||||
#include "jemalloc/internal/malloc_dispatch.h"
|
#include "jemalloc/internal/malloc_dispatch.h"
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
#define JEMALLOC_INTERNAL_INLINES_A_H
|
#define JEMALLOC_INTERNAL_INLINES_A_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_externs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/arena_types.h"
|
|
||||||
#include "jemalloc/internal/arenas_management.h"
|
#include "jemalloc/internal/arenas_management.h"
|
||||||
#include "jemalloc/internal/atomic.h"
|
#include "jemalloc/internal/atomic.h"
|
||||||
#include "jemalloc/internal/bit_util.h"
|
#include "jemalloc/internal/bit_util.h"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define JEMALLOC_INTERNAL_INLINES_C_H
|
#define JEMALLOC_INTERNAL_INLINES_C_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_externs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/arena_inlines_b.h"
|
#include "jemalloc/internal/arena_inlines_b.h"
|
||||||
#include "jemalloc/internal/emap.h"
|
#include "jemalloc/internal/emap.h"
|
||||||
#include "jemalloc/internal/jemalloc_init.h"
|
#include "jemalloc/internal/jemalloc_init.h"
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/edata.h"
|
#include "jemalloc/internal/edata.h"
|
||||||
|
|
||||||
/* Forward decl; only prof_info_t * is used as a pointer arg below. */
|
/* Forward decls; only used as pointer types below. */
|
||||||
|
typedef struct arena_s arena_t;
|
||||||
typedef struct prof_info_s prof_info_t;
|
typedef struct prof_info_s prof_info_t;
|
||||||
|
|
||||||
void *large_malloc(tsdn_t *tsdn, arena_t *arena, size_t usize, bool zero);
|
void *large_malloc(tsdn_t *tsdn, arena_t *arena, size_t usize, bool zero);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define JEMALLOC_INTERNAL_MALLOC_DISPATCH_INLINES_H
|
#define JEMALLOC_INTERNAL_MALLOC_DISPATCH_INLINES_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_externs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/arena_inlines_b.h"
|
#include "jemalloc/internal/arena_inlines_b.h"
|
||||||
#include "jemalloc/internal/bin_inlines.h"
|
#include "jemalloc/internal/bin_inlines.h"
|
||||||
#include "jemalloc/internal/div.h"
|
#include "jemalloc/internal/div.h"
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
#include "jemalloc/internal/thread_event_registry.h"
|
#include "jemalloc/internal/thread_event_registry.h"
|
||||||
#include "jemalloc/internal/ticker.h"
|
#include "jemalloc/internal/ticker.h"
|
||||||
|
|
||||||
/* Forward decl; only base_t * is used as a pointer arg below. */
|
/* Forward decls; only used as pointer types below. */
|
||||||
typedef struct base_s base_t;
|
typedef struct arena_s arena_t;
|
||||||
|
typedef struct base_s base_t;
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* TYPES */
|
/* TYPES */
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define JEMALLOC_INTERNAL_TCACHE_INLINES_H
|
#define JEMALLOC_INTERNAL_TCACHE_INLINES_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_externs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/bin.h"
|
#include "jemalloc/internal/bin.h"
|
||||||
#include "jemalloc/internal/jemalloc_internal_inlines_b.h"
|
#include "jemalloc/internal/jemalloc_internal_inlines_b.h"
|
||||||
#include "jemalloc/internal/jemalloc_internal_types.h"
|
#include "jemalloc/internal/jemalloc_internal_types.h"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#define JEMALLOC_INTERNAL_TSD_INTERNALS_H
|
#define JEMALLOC_INTERNAL_TSD_INTERNALS_H
|
||||||
|
|
||||||
#include "jemalloc/internal/jemalloc_preamble.h"
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||||
#include "jemalloc/internal/arena_types.h"
|
#include "jemalloc/internal/arena_decay_constants.h"
|
||||||
#include "jemalloc/internal/assert.h"
|
#include "jemalloc/internal/assert.h"
|
||||||
#include "jemalloc/internal/tsd_binshards.h"
|
#include "jemalloc/internal/tsd_binshards.h"
|
||||||
#include "jemalloc/internal/jemalloc_internal_externs.h"
|
#include "jemalloc/internal/jemalloc_internal_externs.h"
|
||||||
@@ -16,7 +16,13 @@
|
|||||||
#include "jemalloc/internal/util.h"
|
#include "jemalloc/internal/util.h"
|
||||||
#include "jemalloc/internal/witness.h"
|
#include "jemalloc/internal/witness.h"
|
||||||
|
|
||||||
/* Forward decl; tsd_internals.h only uses prof_tdata_t as a pointer type. */
|
/*
|
||||||
|
* Forward decls. tsd_internals.h cannot include arena.h / prof.h directly:
|
||||||
|
* those headers' STRUCTS-section includes trigger mutex.h -> tsd.h ->
|
||||||
|
* tsd_generic.h, which would re-enter this file before its body finishes.
|
||||||
|
* Each consumer here only uses these as pointer types.
|
||||||
|
*/
|
||||||
|
typedef struct arena_s arena_t;
|
||||||
typedef struct prof_tdata_s prof_tdata_t;
|
typedef struct prof_tdata_s prof_tdata_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "test/extent_hooks.h"
|
#include "test/extent_hooks.h"
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_types.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_extent_body(unsigned arena_ind) {
|
test_extent_body(unsigned arena_ind) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "test/jemalloc_test.h"
|
#include "test/jemalloc_test.h"
|
||||||
#include "test/arena_util.h"
|
#include "test/arena_util.h"
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_structs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/san_bump.h"
|
#include "jemalloc/internal/san_bump.h"
|
||||||
|
|
||||||
static extent_hooks_t *san_bump_default_hooks;
|
static extent_hooks_t *san_bump_default_hooks;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "test/jemalloc_test.h"
|
#include "test/jemalloc_test.h"
|
||||||
|
|
||||||
#include "jemalloc/internal/arena_structs.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
|
|
||||||
#define STRINGIFY_HELPER(x) #x
|
#define STRINGIFY_HELPER(x) #x
|
||||||
#define STRINGIFY(x) STRINGIFY_HELPER(x)
|
#define STRINGIFY(x) STRINGIFY_HELPER(x)
|
||||||
|
|||||||
Reference in New Issue
Block a user