implementation.
Set nkmempages to -1 by default instead of 0 so that the value ends up in
the data section. This way config(8) is able to alter the value as promised.
See also: https://github.com/llvm/llvm-project/issues/74632
OK miod@
-/* $OpenBSD: kern_malloc.c,v 1.150 2023/12/14 11:58:09 claudio Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.151 2023/12/14 14:04:57 claudio Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
* config file.
*/
#ifndef NKMEMPAGES
-#define NKMEMPAGES 0
+#define NKMEMPAGES -1
#endif
u_int nkmempages = NKMEMPAGES;
{
u_int npages;
- if (nkmempages != 0) {
+ if (nkmempages != -1) {
/*
* It's already been set (by us being here before, or
* by patching or kernel config options), bail out now.