These are the compile-time constant strings behind vmstat(1)'s "malloc",
the kern.malloc.kmemnames sysctl(8) and panic strings.

Boots and displays unchanged on amd64:
ffffffff82068690 g     O .rodata        0000000000000490 memname

OK?

Index: kern/kern_malloc.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_malloc.c,v
retrieving revision 1.148
diff -u -p -r1.148 kern_malloc.c
--- kern/kern_malloc.c  14 Aug 2022 01:58:27 -0000      1.148
+++ kern/kern_malloc.c  21 Oct 2022 18:10:37 -0000
@@ -111,7 +111,7 @@ char *kmembase, *kmemlimit;
 char buckstring[16 * sizeof("123456,")];
 int buckstring_init = 0;
 #if defined(KMEMSTATS) || defined(DIAGNOSTIC)
-char *memname[] = INITKMEMNAMES;
+const char * const memname[] = INITKMEMNAMES;
 char *memall = NULL;
 struct rwlock sysctl_kmemlock = RWLOCK_INITIALIZER("sysctlklk");
 #endif
@@ -163,7 +163,7 @@ malloc(size_t size, int type, int flags)
        int s;
 #ifdef DIAGNOSTIC
        int freshalloc;
-       char *savedtype;
+       const char *savedtype;
 #endif
 #ifdef KMEMSTATS
        struct kmemstats *ksp = &kmemstats[type];

Reply via email to