Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/malloc.h
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| #include <sys/_mutex.h> | #include <sys/_mutex.h> | ||||
| #include <machine/_limits.h> | #include <machine/_limits.h> | ||||
| #define MINALLOCSIZE UMA_SMALLEST_UNIT | #define MINALLOCSIZE UMA_SMALLEST_UNIT | ||||
| /* | /* | ||||
| * Flags to memory allocation functions. | * Flags to memory allocation functions. | ||||
| */ | */ | ||||
| #define M_NOWAIT 0x0001 /* do not block */ | #define M_NOWAIT 0x0001 /* do not block */ | ||||
kib: I think it is time to use 8 digits for M_ constants. Or use the flags from low byte, they are… | |||||
| #define M_WAITOK 0x0002 /* ok to block */ | #define M_WAITOK 0x0002 /* ok to block */ | ||||
| #define M_ZERO 0x0100 /* bzero the allocation */ | #define M_ZERO 0x0100 /* bzero the allocation */ | ||||
| #define M_NOVM 0x0200 /* don't ask VM for pages */ | #define M_NOVM 0x0200 /* don't ask VM for pages */ | ||||
| #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ | #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ | ||||
| #define M_NODUMP 0x0800 /* don't dump pages in this allocation */ | #define M_NODUMP 0x0800 /* don't dump pages in this allocation */ | ||||
| #define M_FIRSTFIT 0x1000 /* only for vmem, fast fit */ | #define M_FIRSTFIT 0x1000 /* only for vmem, fast fit */ | ||||
| #define M_BESTFIT 0x2000 /* only for vmem, low fragmentation */ | #define M_BESTFIT 0x2000 /* only for vmem, low fragmentation */ | ||||
| #define M_EXEC 0x4000 /* allocate executable space */ | #define M_EXEC 0x4000 /* allocate executable space */ | ||||
| #define M_NEXTFIT 0x8000 /* only for vmem, follow cursor */ | #define M_NEXTFIT 0x8000 /* only for vmem, follow cursor */ | ||||
| #define M_NORECLAIM 0x10000 /* do not reclaim after failure */ | |||||
| #define M_VERSION 2020110501 | #define M_VERSION 2020110501 | ||||
| /* | /* | ||||
| * Two malloc type structures are present: malloc_type, which is used by a | * Two malloc type structures are present: malloc_type, which is used by a | ||||
| * type owner to declare the type, and malloc_type_internal, which holds | * type owner to declare the type, and malloc_type_internal, which holds | ||||
| * malloc-owned statistics and other ABI-sensitive fields, such as the set of | * malloc-owned statistics and other ABI-sensitive fields, such as the set of | ||||
| * malloc statistics indexed by the compile-time MAXCPU constant. | * malloc statistics indexed by the compile-time MAXCPU constant. | ||||
| ▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines | |||||
I think it is time to use 8 digits for M_ constants. Or use the flags from low byte, they are available I believe.