Fix -Wmissing-prototypes, -Wmissing-variable-declarations, and -Wstrict-prototypes warnings

This commit is contained in:
Slobodan Predolac
2026-06-05 10:23:22 -07:00
parent 6054b976ef
commit a6048680a8
7 changed files with 12 additions and 9 deletions

View File

@@ -7,9 +7,9 @@ void malloc_conf_init(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
char readlink_buf[PATH_MAX + 1]); char readlink_buf[PATH_MAX + 1]);
void malloc_abort_invalid_conf(void); void malloc_abort_invalid_conf(void);
#ifdef JEMALLOC_JET
extern bool had_conf_error; extern bool had_conf_error;
#ifdef JEMALLOC_JET
bool conf_next(char const **opts_p, char const **k_p, size_t *klen_p, bool conf_next(char const **opts_p, char const **k_p, size_t *klen_p,
char const **v_p, size_t *vlen_p); char const **v_p, size_t *vlen_p);
void conf_error( void conf_error(

View File

@@ -43,6 +43,9 @@ extern char opt_stats_interval_opts[stats_print_tot_num_options + 1];
#define STATS_INTERVAL_ACCUM_LG_BATCH_SIZE 6 #define STATS_INTERVAL_ACCUM_LG_BATCH_SIZE 6
#define STATS_INTERVAL_ACCUM_BATCH_MAX (4 << 20) #define STATS_INTERVAL_ACCUM_BATCH_MAX (4 << 20)
/* Per thread batch accum size for stats_interval; read by thread event. */
extern uint64_t stats_interval_accum_batch;
/* Only accessed by thread event. */ /* Only accessed by thread event. */
extern te_base_cb_t stats_interval_te_handler; extern te_base_cb_t stats_interval_te_handler;

View File

@@ -783,7 +783,7 @@ os_overcommits_proc(void) {
#endif #endif
static bool static bool
pages_should_skip_set_thp_state() { pages_should_skip_set_thp_state(void) {
if (opt_thp == thp_mode_do_nothing if (opt_thp == thp_mode_do_nothing
|| (opt_thp == thp_mode_always || (opt_thp == thp_mode_always
&& init_system_thp_mode == system_thp_mode_always) && init_system_thp_mode == system_thp_mode_always)

View File

@@ -295,7 +295,7 @@ prof_sample_new_event_wait(tsd_t *tsd) {
#endif #endif
} }
void static void
prof_sample_event_handler(tsd_t *tsd) { prof_sample_event_handler(tsd_t *tsd) {
cassert(config_prof); cassert(config_prof);
if (prof_interval == 0 || !prof_active_get_unlocked()) { if (prof_interval == 0 || !prof_active_get_unlocked()) {

View File

@@ -2208,17 +2208,17 @@ stats_print(write_cb_t *write_cb, void *cbopaque, const char *opts) {
emitter_end(&emitter); emitter_end(&emitter);
} }
uint64_t static uint64_t
stats_interval_new_event_wait(tsd_t *tsd) { stats_interval_new_event_wait(tsd_t *tsd) {
return stats_interval_accum_batch; return stats_interval_accum_batch;
} }
uint64_t static uint64_t
stats_interval_postponed_event_wait(tsd_t *tsd) { stats_interval_postponed_event_wait(tsd_t *tsd) {
return TE_MIN_START_WAIT; return TE_MIN_START_WAIT;
} }
void static void
stats_interval_event_handler(tsd_t *tsd) { stats_interval_event_handler(tsd_t *tsd) {
uint64_t last_event = thread_allocated_last_event_get(tsd); uint64_t last_event = thread_allocated_last_event_get(tsd);
uint64_t last_sample_event = tsd_stats_interval_last_event_get(tsd); uint64_t last_sample_event = tsd_stats_interval_last_event_get(tsd);

View File

@@ -112,12 +112,12 @@ tcache_salloc(tsdn_t *tsdn, const void *ptr) {
return arena_salloc(tsdn, ptr); return arena_salloc(tsdn, ptr);
} }
uint64_t static uint64_t
tcache_gc_new_event_wait(tsd_t *tsd) { tcache_gc_new_event_wait(tsd_t *tsd) {
return opt_tcache_gc_incr_bytes; return opt_tcache_gc_incr_bytes;
} }
uint64_t static uint64_t
tcache_gc_postponed_event_wait(tsd_t *tsd) { tcache_gc_postponed_event_wait(tsd_t *tsd) {
return TE_MIN_START_WAIT; return TE_MIN_START_WAIT;
} }

View File

@@ -3,6 +3,7 @@
#include "jemalloc/internal/jemalloc_internal_inlines_a.h" #include "jemalloc/internal/jemalloc_internal_inlines_a.h"
#include "jemalloc/internal/peak_event.h" #include "jemalloc/internal/peak_event.h"
#include "jemalloc/internal/prof.h" #include "jemalloc/internal/prof.h"
#include "jemalloc/internal/stats.h"
#include "jemalloc/internal/tcache.h" #include "jemalloc/internal/tcache.h"
#include "jemalloc/internal/thread_event.h" #include "jemalloc/internal/thread_event.h"
#include "jemalloc/internal/thread_event_registry.h" #include "jemalloc/internal/thread_event_registry.h"
@@ -185,7 +186,6 @@ te_update_wait(tsd_t *tsd, uint64_t accumbytes, bool allow, uint64_t *ev_wait,
return ret; return ret;
} }
extern uint64_t stats_interval_accum_batch;
/* Return number of handlers enqueued into to_trigger array */ /* Return number of handlers enqueued into to_trigger array */
static inline size_t static inline size_t
te_update_alloc_events(tsd_t *tsd, te_base_cb_t **to_trigger, te_update_alloc_events(tsd_t *tsd, te_base_cb_t **to_trigger,