mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
malloc(9): Introduce M_NEVERFREED
This patch adds an additional malloc(9) flag to distinguish allocations that are never freed during runtime. Differential Revision: https://reviews.freebsd.org/D45045 Reviewed by: alc, kib, markj Tested by: alc
This commit is contained in:
parent
2204a48290
commit
78f3e0f6b3
@ -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 freed */
|
||||
|
||||
#define M_VERSION 2020110501
|
||||
#define M_VERSION 2024073001
|
||||
|
||||
/*
|
||||
* Two malloc type structures are present: malloc_type, which is used by a
|
||||
|
@ -1791,6 +1791,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags,
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user