Module Name:    src
Committed By:   christos
Date:           Mon Sep 23 22:37:35 UTC 2024

Modified Files:
        src/external/bsd/jemalloc/dist/src: fxp.c hpa.c inspect.c prof_data.c
            prof_recent.c safety_check.c
        src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
fix static linking


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/fxp.c \
    src/external/bsd/jemalloc/dist/src/hpa.c \
    src/external/bsd/jemalloc/dist/src/inspect.c \
    src/external/bsd/jemalloc/dist/src/prof_data.c \
    src/external/bsd/jemalloc/dist/src/prof_recent.c \
    src/external/bsd/jemalloc/dist/src/safety_check.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/jemalloc/lib/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/jemalloc/dist/src/fxp.c
diff -u src/external/bsd/jemalloc/dist/src/fxp.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/fxp.c:1.2
--- src/external/bsd/jemalloc/dist/src/fxp.c:1.1.1.1	Mon Sep 23 10:59:43 2024
+++ src/external/bsd/jemalloc/dist/src/fxp.c	Mon Sep 23 18:37:35 2024
@@ -43,7 +43,7 @@ fxp_parse(fxp_t *result, const char *str
 	if (*cur != '.') {
 		*result = (integer_part << 16);
 		if (end != NULL) {
-			*end = (char *)cur;
+			*end = (char *)__UNCONST(cur);
 		}
 		return false;
 	}
@@ -89,7 +89,7 @@ fxp_parse(fxp_t *result, const char *str
 	/* Success! */
 	*result = (integer_part << 16) + fractional_repr;
 	if (end != NULL) {
-		*end = (char *)cur;
+		*end = (char *)__UNCONST(cur);
 	}
 	return false;
 }
Index: src/external/bsd/jemalloc/dist/src/hpa.c
diff -u src/external/bsd/jemalloc/dist/src/hpa.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/hpa.c:1.2
--- src/external/bsd/jemalloc/dist/src/hpa.c:1.1.1.1	Mon Sep 23 10:59:43 2024
+++ src/external/bsd/jemalloc/dist/src/hpa.c	Mon Sep 23 18:37:35 2024
@@ -24,7 +24,7 @@ static void hpa_dalloc_batch(tsdn_t *tsd
 static uint64_t hpa_time_until_deferred_work(tsdn_t *tsdn, pai_t *self);
 
 bool
-hpa_supported() {
+hpa_supported(void) {
 #ifdef _WIN32
 	/*
 	 * At least until the API and implementation is somewhat settled, we
@@ -87,7 +87,7 @@ hpa_alloc_ps(tsdn_t *tsdn, hpa_central_t
 	    CACHELINE);
 }
 
-hpdata_t *
+static hpdata_t *
 hpa_central_extract(tsdn_t *tsdn, hpa_central_t *central, size_t size,
     bool *oom) {
 	/* Don't yet support big allocations; these should get filtered out. */
Index: src/external/bsd/jemalloc/dist/src/inspect.c
diff -u src/external/bsd/jemalloc/dist/src/inspect.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/inspect.c:1.2
--- src/external/bsd/jemalloc/dist/src/inspect.c:1.1.1.1	Mon Sep 23 10:59:43 2024
+++ src/external/bsd/jemalloc/dist/src/inspect.c	Mon Sep 23 18:37:35 2024
@@ -1,5 +1,6 @@
 #include "jemalloc/internal/jemalloc_preamble.h"
 #include "jemalloc/internal/jemalloc_internal_includes.h"
+#include "jemalloc/internal/inspect.h"
 
 void
 inspect_extent_util_stats_get(tsdn_t *tsdn, const void *ptr, size_t *nfree,
Index: src/external/bsd/jemalloc/dist/src/prof_data.c
diff -u src/external/bsd/jemalloc/dist/src/prof_data.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/prof_data.c:1.2
--- src/external/bsd/jemalloc/dist/src/prof_data.c:1.1.1.1	Mon Sep 23 10:59:43 2024
+++ src/external/bsd/jemalloc/dist/src/prof_data.c	Mon Sep 23 18:37:35 2024
@@ -452,7 +452,7 @@ prof_thread_name_alloc(tsd_t *tsd, const
 
 	size = strlen(thread_name) + 1;
 	if (size == 1) {
-		return "";
+		return __UNCONST("");
 	}
 
 	ret = iallocztm(tsd_tsdn(tsd), size, sz_size2index(size), false, NULL,
@@ -482,7 +482,7 @@ prof_thread_name_set_impl(tsd_t *tsd, co
 		return EFAULT;
 	}
 	for (i = 0; thread_name[i] != '\0'; i++) {
-		char c = thread_name[i];
+		unsigned char c = thread_name[i];
 		if (!isgraph(c) && !isblank(c)) {
 			return EFAULT;
 		}
@@ -538,7 +538,7 @@ prof_double_uint64_cast(double d) {
 }
 #endif
 
-void prof_unbias_map_init() {
+void prof_unbias_map_init(void) {
 	/* See the comment in prof_sample_new_event_wait */
 #ifdef JEMALLOC_PROF
 	for (szind_t i = 0; i < SC_NSIZES; i++) {
@@ -1137,7 +1137,7 @@ prof_cnt_all(prof_cnt_t *cnt_all) {
 
 void
 prof_bt_hash(const void *key, size_t r_hash[2]) {
-	prof_bt_t *bt = (prof_bt_t *)key;
+	prof_bt_t *bt = (prof_bt_t *)__UNCONST(key);
 
 	cassert(config_prof);
 
@@ -1146,8 +1146,8 @@ prof_bt_hash(const void *key, size_t r_h
 
 bool
 prof_bt_keycomp(const void *k1, const void *k2) {
-	const prof_bt_t *bt1 = (prof_bt_t *)k1;
-	const prof_bt_t *bt2 = (prof_bt_t *)k2;
+	const prof_bt_t *bt1 = (const prof_bt_t *)k1;
+	const prof_bt_t *bt2 = (const prof_bt_t *)k2;
 
 	cassert(config_prof);
 
Index: src/external/bsd/jemalloc/dist/src/prof_recent.c
diff -u src/external/bsd/jemalloc/dist/src/prof_recent.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/prof_recent.c:1.2
--- src/external/bsd/jemalloc/dist/src/prof_recent.c:1.1.1.1	Mon Sep 23 10:59:43 2024
+++ src/external/bsd/jemalloc/dist/src/prof_recent.c	Mon Sep 23 18:37:35 2024
@@ -16,13 +16,13 @@ prof_recent_list_t prof_recent_alloc_lis
 malloc_mutex_t prof_recent_dump_mtx; /* Protects dumping. */
 
 static void
-prof_recent_alloc_max_init() {
+prof_recent_alloc_max_init(void) {
 	atomic_store_zd(&prof_recent_alloc_max, opt_prof_recent_alloc_max,
 	    ATOMIC_RELAXED);
 }
 
 static inline ssize_t
-prof_recent_alloc_max_get_no_lock() {
+prof_recent_alloc_max_get_no_lock(void) {
 	return atomic_load_zd(&prof_recent_alloc_max, ATOMIC_RELAXED);
 }
 
@@ -403,7 +403,7 @@ label_rollback:
 }
 
 ssize_t
-prof_recent_alloc_max_ctl_read() {
+prof_recent_alloc_max_ctl_read(void) {
 	cassert(config_prof);
 	/* Don't bother to acquire the lock. */
 	return prof_recent_alloc_max_get_no_lock();
@@ -580,7 +580,7 @@ prof_recent_alloc_dump(tsd_t *tsd, write
 #undef PROF_RECENT_PRINT_BUFSIZE
 
 bool
-prof_recent_init() {
+prof_recent_init(void) {
 	cassert(config_prof);
 	prof_recent_alloc_max_init();
 
Index: src/external/bsd/jemalloc/dist/src/safety_check.c
diff -u src/external/bsd/jemalloc/dist/src/safety_check.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/safety_check.c:1.2
--- src/external/bsd/jemalloc/dist/src/safety_check.c:1.1.1.1	Mon Sep 23 10:59:43 2024
+++ src/external/bsd/jemalloc/dist/src/safety_check.c	Mon Sep 23 18:37:35 2024
@@ -5,7 +5,7 @@ static safety_check_abort_hook_t safety_
 
 void safety_check_fail_sized_dealloc(bool current_dealloc, const void *ptr,
     size_t true_size, size_t input_size) {
-	char *src = current_dealloc ? "the current pointer being freed" :
+	const char *src = current_dealloc ? "the current pointer being freed" :
 	    "in thread cache, possibly from previous deallocations";
 
 	safety_check_fail("<jemalloc>: size mismatch detected (true size %zu "

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.18 src/external/bsd/jemalloc/lib/Makefile.inc:1.19
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.18	Mon Sep 23 13:53:42 2024
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Mon Sep 23 18:37:35 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.18 2024/09/23 17:53:42 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2024/09/23 22:37:35 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -27,23 +27,34 @@ exp_grow.c \
 extent.c \
 extent_dss.c \
 extent_mmap.c \
+fxp.c \
 hash.c \
+hpa.c \
 hpa_hooks.c \
+hpdata.c \
 hook.c \
+inspect.c \
 large.c \
 log.c \
 malloc_io.c \
 mutex.c \
 nstime.c \
 pa.c \
+pa_extra.c \
 pac.c \
 pai.c \
 pages.c \
 peak_event.c \
 prof.c \
+prof_data.c \
+prof_recent.c \
+psset.c \
 rtree.c \
+safety_check.c \
 san.c \
+san_bump.c \
 sc.c \
+sec.c \
 stats.c \
 sz.c \
 test_hooks.c \
@@ -90,8 +101,11 @@ LINTFLAGS.ctl.c += -X 135,239,298
 LINTFLAGS.extent.c += -X 239
 LINTFLAGS.jemalloc.c += -X 236	# XXX: lint bug, it is a constructor
 LINTFLAGS.pages.c += -X 298
+LINTFLAGS.prof_data.c += -X 236
+LINTFLAGS.prof_recent.c += -X 42
 LINTFLAGS.rtree.c += -X 239
 LINTFLAGS.sc.c += -X 119,239
+LINTFLAGS.sec.c += -X 247
 LINTFLAGS.stats.c += -X 42,135,239,247
 LINTFLAGS.tcache.c += -X 239,309
 LINTFLAGS.thread_event.c += -X 239

Reply via email to