diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -60,8 +60,9 @@ #define M_BESTFIT 0x2000 /* only for vmem, low fragmentation */ #define M_EXEC 0x4000 /* allocate executable space */ #define M_NEXTFIT 0x8000 /* only for vmem, follow cursor */ +#define M_NEVERFREED 0x10000 /* chunk will never get free'd */ -#define M_VERSION 2020110501 +#define M_VERSION 2024042901 /* * Two malloc type structures are present: malloc_type, which is used by a diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1791,6 +1791,9 @@ if (keg->uk_flags & UMA_ZONE_NODUMP) aflags |= M_NODUMP; + if (keg->uk_flags & UMA_ZONE_NOFREE) + aflags |= M_NEVERFREED; + /* zone is passed for legacy reasons. */ size = keg->uk_ppera * PAGE_SIZE; mem = keg->uk_allocf(zone, size, domain, &sflags, aflags);