Clean compilation -Wextra
Before this commit jemalloc produced many warnings when compiled with -Wextra with both Clang and GCC. This commit fixes the issues raised by these warnings or suppresses them if they were spurious at least for the Clang and GCC versions covered by CI. This commit: * adds `JEMALLOC_DIAGNOSTIC` macros: `JEMALLOC_DIAGNOSTIC_{PUSH,POP}` are used to modify the stack of enabled diagnostics. The `JEMALLOC_DIAGNOSTIC_IGNORE_...` macros are used to ignore a concrete diagnostic. * adds `JEMALLOC_FALLTHROUGH` macro to explicitly state that falling through `case` labels in a `switch` statement is intended * Removes all UNUSED annotations on function parameters. The warning -Wunused-parameter is now disabled globally in `jemalloc_internal_macros.h` for all translation units that include that header. It is never re-enabled since that header cannot be included by users. * locally suppresses some -Wextra diagnostics: * `-Wmissing-field-initializer` is buggy in older Clang and GCC versions, where it does not understanding that, in C, `= {0}` is a common C idiom to initialize a struct to zero * `-Wtype-bounds` is suppressed in a particular situation where a generic macro, used in multiple different places, compares an unsigned integer for smaller than zero, which is always true. * `-Walloc-larger-than-size=` diagnostics warn when an allocation function is called with a size that is too large (out-of-range). These are suppressed in the parts of the tests where `jemalloc` explicitly does this to test that the allocation functions fail properly. * adds a new CI build bot that runs the log unit test on CI. Closes #1196 .
This commit is contained in:
12
src/arena.c
12
src/arena.c
@@ -11,6 +11,8 @@
|
||||
#include "jemalloc/internal/size_classes.h"
|
||||
#include "jemalloc/internal/util.h"
|
||||
|
||||
JEMALLOC_DIAGNOSTIC_DISABLE_SPURIOUS
|
||||
|
||||
/******************************************************************************/
|
||||
/* Data. */
|
||||
|
||||
@@ -65,7 +67,7 @@ static void arena_bin_lower_slab(tsdn_t *tsdn, arena_t *arena, extent_t *slab,
|
||||
/******************************************************************************/
|
||||
|
||||
void
|
||||
arena_basic_stats_merge(UNUSED tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
||||
arena_basic_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
||||
const char **dss, ssize_t *dirty_decay_ms, ssize_t *muzzy_decay_ms,
|
||||
size_t *nactive, size_t *ndirty, size_t *nmuzzy) {
|
||||
*nthreads += arena_nthreads_get(arena, false);
|
||||
@@ -752,7 +754,7 @@ static size_t
|
||||
arena_decay_stashed(tsdn_t *tsdn, arena_t *arena,
|
||||
extent_hooks_t **r_extent_hooks, arena_decay_t *decay, extents_t *extents,
|
||||
bool all, extent_list_t *decay_extents, bool is_background_thread) {
|
||||
UNUSED size_t nmadvise, nunmapped;
|
||||
size_t nmadvise, nunmapped;
|
||||
size_t npurged;
|
||||
|
||||
if (config_stats) {
|
||||
@@ -843,7 +845,7 @@ arena_decay_to_limit(tsdn_t *tsdn, arena_t *arena, arena_decay_t *decay,
|
||||
size_t npurge = arena_stash_decayed(tsdn, arena, &extent_hooks, extents,
|
||||
npages_limit, npages_decay_max, &decay_extents);
|
||||
if (npurge != 0) {
|
||||
UNUSED size_t npurged = arena_decay_stashed(tsdn, arena,
|
||||
size_t npurged = arena_decay_stashed(tsdn, arena,
|
||||
&extent_hooks, decay, extents, all, &decay_extents,
|
||||
is_background_thread);
|
||||
assert(npurged == npurge);
|
||||
@@ -872,7 +874,7 @@ arena_decay_impl(tsdn_t *tsdn, arena_t *arena, arena_decay_t *decay,
|
||||
|
||||
bool epoch_advanced = arena_maybe_decay(tsdn, arena, decay, extents,
|
||||
is_background_thread);
|
||||
UNUSED size_t npages_new;
|
||||
size_t npages_new;
|
||||
if (epoch_advanced) {
|
||||
/* Backlog is updated on epoch advance. */
|
||||
npages_new = decay->backlog[SMOOTHSTEP_NSTEPS-1];
|
||||
@@ -1508,7 +1510,7 @@ arena_dalloc_bin_slab(tsdn_t *tsdn, arena_t *arena, extent_t *slab,
|
||||
}
|
||||
|
||||
static void
|
||||
arena_bin_lower_slab(UNUSED tsdn_t *tsdn, arena_t *arena, extent_t *slab,
|
||||
arena_bin_lower_slab(tsdn_t *tsdn, arena_t *arena, extent_t *slab,
|
||||
bin_t *bin) {
|
||||
assert(extent_nfree_get(slab) > 0);
|
||||
|
||||
|
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "jemalloc/internal/assert.h"
|
||||
|
||||
JEMALLOC_DIAGNOSTIC_DISABLE_SPURIOUS
|
||||
|
||||
/******************************************************************************/
|
||||
/* Data. */
|
||||
|
||||
@@ -78,7 +80,7 @@ background_thread_info_init(tsdn_t *tsdn, background_thread_info_t *info) {
|
||||
}
|
||||
|
||||
static inline bool
|
||||
set_current_thread_affinity(UNUSED int cpu) {
|
||||
set_current_thread_affinity(int cpu) {
|
||||
#if defined(JEMALLOC_HAVE_SCHED_SETAFFINITY)
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
136
src/ctl.c
136
src/ctl.c
@@ -1392,8 +1392,8 @@ label_return: \
|
||||
|
||||
#define CTL_RO_CGEN(c, n, v, t) \
|
||||
static int \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
|
||||
size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, \
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
int ret; \
|
||||
t oldval; \
|
||||
\
|
||||
@@ -1435,8 +1435,8 @@ label_return: \
|
||||
*/
|
||||
#define CTL_RO_NL_CGEN(c, n, v, t) \
|
||||
static int \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
|
||||
size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, \
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
int ret; \
|
||||
t oldval; \
|
||||
\
|
||||
@@ -1454,8 +1454,8 @@ label_return: \
|
||||
|
||||
#define CTL_RO_NL_GEN(n, v, t) \
|
||||
static int \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
|
||||
size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, \
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
int ret; \
|
||||
t oldval; \
|
||||
\
|
||||
@@ -1489,8 +1489,8 @@ label_return: \
|
||||
|
||||
#define CTL_RO_CONFIG_GEN(n, t) \
|
||||
static int \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
|
||||
size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, \
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
int ret; \
|
||||
t oldval; \
|
||||
\
|
||||
@@ -1508,8 +1508,8 @@ label_return: \
|
||||
CTL_RO_NL_GEN(version, JEMALLOC_VERSION, const char *)
|
||||
|
||||
static int
|
||||
epoch_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
epoch_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
UNUSED uint64_t newval;
|
||||
|
||||
@@ -1527,8 +1527,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
background_thread_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
background_thread_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp,
|
||||
void *newp, size_t newlen) {
|
||||
int ret;
|
||||
bool oldval;
|
||||
|
||||
@@ -1578,8 +1579,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
max_background_threads_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
max_background_threads_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
size_t oldval;
|
||||
|
||||
@@ -1691,8 +1693,8 @@ CTL_RO_NL_CGEN(config_prof, opt_prof_leak, opt_prof_leak, bool)
|
||||
/******************************************************************************/
|
||||
|
||||
static int
|
||||
thread_arena_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
thread_arena_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
arena_t *oldarena;
|
||||
unsigned newind, oldind;
|
||||
@@ -1756,8 +1758,9 @@ CTL_TSD_RO_NL_CGEN(config_stats, thread_deallocatedp,
|
||||
tsd_thread_deallocatedp_get, uint64_t *)
|
||||
|
||||
static int
|
||||
thread_tcache_enabled_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
thread_tcache_enabled_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
bool oldval;
|
||||
|
||||
@@ -1777,8 +1780,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
thread_tcache_flush_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
thread_tcache_flush_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
|
||||
if (!tcache_available(tsd)) {
|
||||
@@ -1797,8 +1801,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
thread_prof_name_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
thread_prof_name_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
|
||||
if (!config_prof) {
|
||||
@@ -1828,8 +1833,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
thread_prof_active_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
thread_prof_active_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
bool oldval;
|
||||
|
||||
@@ -1858,8 +1864,8 @@ label_return:
|
||||
/******************************************************************************/
|
||||
|
||||
static int
|
||||
tcache_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
tcache_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
unsigned tcache_ind;
|
||||
|
||||
@@ -1876,8 +1882,8 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
tcache_flush_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
tcache_flush_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
unsigned tcache_ind;
|
||||
|
||||
@@ -1896,8 +1902,8 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
tcache_destroy_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
tcache_destroy_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
unsigned tcache_ind;
|
||||
|
||||
@@ -2299,8 +2305,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
arena_i_retain_grow_limit_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
arena_i_retain_grow_limit_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
unsigned arena_ind;
|
||||
arena_t *arena;
|
||||
@@ -2335,7 +2342,8 @@ label_return:
|
||||
}
|
||||
|
||||
static const ctl_named_node_t *
|
||||
arena_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen, size_t i) {
|
||||
arena_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen,
|
||||
size_t i) {
|
||||
const ctl_named_node_t *ret;
|
||||
|
||||
malloc_mutex_lock(tsdn, &ctl_mtx);
|
||||
@@ -2360,8 +2368,8 @@ label_return:
|
||||
/******************************************************************************/
|
||||
|
||||
static int
|
||||
arenas_narenas_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
arenas_narenas_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
unsigned narenas;
|
||||
|
||||
@@ -2381,8 +2389,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
arenas_decay_ms_ctl_impl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen, bool dirty) {
|
||||
arenas_decay_ms_ctl_impl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen, bool dirty) {
|
||||
int ret;
|
||||
|
||||
if (oldp != NULL && oldlenp != NULL) {
|
||||
@@ -2430,7 +2439,8 @@ CTL_RO_NL_GEN(arenas_bin_i_size, bin_infos[mib[2]].reg_size, size_t)
|
||||
CTL_RO_NL_GEN(arenas_bin_i_nregs, bin_infos[mib[2]].nregs, uint32_t)
|
||||
CTL_RO_NL_GEN(arenas_bin_i_slab_size, bin_infos[mib[2]].slab_size, size_t)
|
||||
static const ctl_named_node_t *
|
||||
arenas_bin_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen, size_t i) {
|
||||
arenas_bin_i_index(tsdn_t *tsdn, const size_t *mib,
|
||||
size_t miblen, size_t i) {
|
||||
if (i > NBINS) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -2441,8 +2451,8 @@ CTL_RO_NL_GEN(arenas_nlextents, NSIZES - NBINS, unsigned)
|
||||
CTL_RO_NL_GEN(arenas_lextent_i_size, sz_index2size(NBINS+(szind_t)mib[2]),
|
||||
size_t)
|
||||
static const ctl_named_node_t *
|
||||
arenas_lextent_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen,
|
||||
size_t i) {
|
||||
arenas_lextent_i_index(tsdn_t *tsdn, const size_t *mib,
|
||||
size_t miblen, size_t i) {
|
||||
if (i > NSIZES - NBINS) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -2450,8 +2460,8 @@ arenas_lextent_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen,
|
||||
}
|
||||
|
||||
static int
|
||||
arenas_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
arenas_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
extent_hooks_t *extent_hooks;
|
||||
unsigned arena_ind;
|
||||
@@ -2473,8 +2483,9 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
arenas_lookup_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
arenas_lookup_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
unsigned arena_ind;
|
||||
void *ptr;
|
||||
@@ -2505,8 +2516,9 @@ label_return:
|
||||
/******************************************************************************/
|
||||
|
||||
static int
|
||||
prof_thread_active_init_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
prof_thread_active_init_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp, void *newp,
|
||||
size_t newlen) {
|
||||
int ret;
|
||||
bool oldval;
|
||||
|
||||
@@ -2532,8 +2544,8 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
prof_active_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
prof_active_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
bool oldval;
|
||||
|
||||
@@ -2558,8 +2570,8 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
prof_dump_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
prof_dump_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
const char *filename = NULL;
|
||||
|
||||
@@ -2581,8 +2593,8 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
prof_gdump_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
prof_gdump_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
bool oldval;
|
||||
|
||||
@@ -2607,8 +2619,8 @@ label_return:
|
||||
}
|
||||
|
||||
static int
|
||||
prof_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen) {
|
||||
prof_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
int ret;
|
||||
size_t lg_sample = lg_prof_sample;
|
||||
|
||||
@@ -2764,8 +2776,9 @@ RO_MUTEX_CTL_GEN(arenas_i_bins_j_mutex,
|
||||
|
||||
/* Resets all mutex stats, including global, arena and bin mutexes. */
|
||||
static int
|
||||
stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
||||
void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
|
||||
stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib,
|
||||
size_t miblen, void *oldp, size_t *oldlenp,
|
||||
void *newp, size_t newlen) {
|
||||
if (!config_stats) {
|
||||
return ENOENT;
|
||||
}
|
||||
@@ -2834,8 +2847,8 @@ CTL_RO_CGEN(config_stats, stats_arenas_i_bins_j_curslabs,
|
||||
arenas_i(mib[2])->astats->bstats[mib[4]].curslabs, size_t)
|
||||
|
||||
static const ctl_named_node_t *
|
||||
stats_arenas_i_bins_j_index(tsdn_t *tsdn, const size_t *mib, size_t miblen,
|
||||
size_t j) {
|
||||
stats_arenas_i_bins_j_index(tsdn_t *tsdn, const size_t *mib,
|
||||
size_t miblen, size_t j) {
|
||||
if (j > NBINS) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -2855,8 +2868,8 @@ CTL_RO_CGEN(config_stats, stats_arenas_i_lextents_j_curlextents,
|
||||
arenas_i(mib[2])->astats->lstats[mib[4]].curlextents, size_t)
|
||||
|
||||
static const ctl_named_node_t *
|
||||
stats_arenas_i_lextents_j_index(tsdn_t *tsdn, const size_t *mib, size_t miblen,
|
||||
size_t j) {
|
||||
stats_arenas_i_lextents_j_index(tsdn_t *tsdn, const size_t *mib,
|
||||
size_t miblen, size_t j) {
|
||||
if (j > NSIZES - NBINS) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -2864,7 +2877,8 @@ stats_arenas_i_lextents_j_index(tsdn_t *tsdn, const size_t *mib, size_t miblen,
|
||||
}
|
||||
|
||||
static const ctl_named_node_t *
|
||||
stats_arenas_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen, size_t i) {
|
||||
stats_arenas_i_index(tsdn_t *tsdn, const size_t *mib,
|
||||
size_t miblen, size_t i) {
|
||||
const ctl_named_node_t *ret;
|
||||
size_t a;
|
||||
|
||||
|
@@ -119,9 +119,13 @@ static void extent_record(tsdn_t *tsdn, arena_t *arena,
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
ph_gen(UNUSED, extent_avail_, extent_tree_t, extent_t, ph_link,
|
||||
#define ATTR_NONE /* does nothing */
|
||||
|
||||
ph_gen(ATTR_NONE, extent_avail_, extent_tree_t, extent_t, ph_link,
|
||||
extent_esnead_comp)
|
||||
|
||||
#undef ATTR_NONE
|
||||
|
||||
typedef enum {
|
||||
lock_result_success,
|
||||
lock_result_failure,
|
||||
|
@@ -970,6 +970,14 @@ malloc_conf_init(void) {
|
||||
} \
|
||||
continue; \
|
||||
}
|
||||
/*
|
||||
* One of the CONF_MIN macros below expands, in one of the use points,
|
||||
* to "unsigned integer < 0", which is always false, triggering the
|
||||
* GCC -Wtype-limits warning, which we disable here and re-enable below.
|
||||
*/
|
||||
JEMALLOC_DIAGNOSTIC_PUSH
|
||||
JEMALLOC_DIAGNOSTIC_IGNORE_TYPE_LIMITS
|
||||
|
||||
#define CONF_MIN_no(um, min) false
|
||||
#define CONF_MIN_yes(um, min) ((um) < (min))
|
||||
#define CONF_MAX_no(um, max) false
|
||||
@@ -1246,6 +1254,8 @@ malloc_conf_init(void) {
|
||||
#undef CONF_HANDLE_SIZE_T
|
||||
#undef CONF_HANDLE_SSIZE_T
|
||||
#undef CONF_HANDLE_CHAR_P
|
||||
/* Re-enable diagnostic "-Wtype-limits" */
|
||||
JEMALLOC_DIAGNOSTIC_POP
|
||||
}
|
||||
if (opt_abort_conf && had_conf_error) {
|
||||
malloc_abort_invalid_conf();
|
||||
@@ -2992,7 +3002,7 @@ label_not_resized:
|
||||
|
||||
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW
|
||||
JEMALLOC_ATTR(pure)
|
||||
je_sallocx(const void *ptr, UNUSED int flags) {
|
||||
je_sallocx(const void *ptr, int flags) {
|
||||
size_t usize;
|
||||
tsdn_t *tsdn;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
|
||||
void
|
||||
malloc_mutex_lock_slow(malloc_mutex_t *mutex) {
|
||||
mutex_prof_data_t *data = &mutex->prof_data;
|
||||
UNUSED nstime_t before = NSTIME_ZERO_INITIALIZER;
|
||||
nstime_t before = NSTIME_ZERO_INITIALIZER;
|
||||
|
||||
if (ncpus == 1) {
|
||||
goto label_spin_done;
|
||||
|
@@ -39,7 +39,7 @@ rtree_node_dalloc_impl(tsdn_t *tsdn, rtree_t *rtree, rtree_node_elm_t *node) {
|
||||
/* Nodes are never deleted during normal operation. */
|
||||
not_reached();
|
||||
}
|
||||
UNUSED rtree_node_dalloc_t *JET_MUTABLE rtree_node_dalloc =
|
||||
rtree_node_dalloc_t *JET_MUTABLE rtree_node_dalloc =
|
||||
rtree_node_dalloc_impl;
|
||||
|
||||
static rtree_leaf_elm_t *
|
||||
@@ -54,7 +54,7 @@ rtree_leaf_dalloc_impl(tsdn_t *tsdn, rtree_t *rtree, rtree_leaf_elm_t *leaf) {
|
||||
/* Leaves are never deleted during normal operation. */
|
||||
not_reached();
|
||||
}
|
||||
UNUSED rtree_leaf_dalloc_t *JET_MUTABLE rtree_leaf_dalloc =
|
||||
rtree_leaf_dalloc_t *JET_MUTABLE rtree_leaf_dalloc =
|
||||
rtree_leaf_dalloc_impl;
|
||||
|
||||
#ifdef JEMALLOC_JET
|
||||
|
@@ -206,7 +206,7 @@ tcache_bin_flush_large(tsd_t *tsd, cache_bin_t *tbin, szind_t binind,
|
||||
/* Lock the arena associated with the first object. */
|
||||
extent_t *extent = item_extent[0];
|
||||
arena_t *locked_arena = extent_arena_get(extent);
|
||||
UNUSED bool idump;
|
||||
bool idump;
|
||||
|
||||
if (config_prof) {
|
||||
idump = false;
|
||||
|
@@ -12,6 +12,10 @@
|
||||
static unsigned ncleanups;
|
||||
static malloc_tsd_cleanup_t cleanups[MALLOC_TSD_CLEANUPS_MAX];
|
||||
|
||||
/* TSD_INITIALIZER triggers "-Wmissing-field-initializer" */
|
||||
JEMALLOC_DIAGNOSTIC_PUSH
|
||||
JEMALLOC_DIAGNOSTIC_IGNORE_MISSING_STRUCT_FIELD_INITIALIZERS
|
||||
|
||||
#ifdef JEMALLOC_MALLOC_THREAD_CLEANUP
|
||||
__thread tsd_t JEMALLOC_TLS_MODEL tsd_tls = TSD_INITIALIZER;
|
||||
__thread bool JEMALLOC_TLS_MODEL tsd_initialized = false;
|
||||
@@ -41,6 +45,7 @@ tsd_init_head_t tsd_init_head = {
|
||||
ql_head_initializer(blocks),
|
||||
MALLOC_MUTEX_INITIALIZER
|
||||
};
|
||||
|
||||
tsd_wrapper_t tsd_boot_wrapper = {
|
||||
false,
|
||||
TSD_INITIALIZER
|
||||
@@ -48,6 +53,7 @@ tsd_wrapper_t tsd_boot_wrapper = {
|
||||
bool tsd_booted = false;
|
||||
#endif
|
||||
|
||||
JEMALLOC_DIAGNOSTIC_POP
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
Reference in New Issue
Block a user