diff options
author | bde <bde@FreeBSD.org> | 2002-09-15 17:10:18 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2002-09-15 17:10:18 +0000 |
commit | 66a17c64befa7b46733cddb36bb548fed0497276 (patch) | |
tree | 3c4696e833b3e781128c4655203dfa61f6b5d08c /sys | |
parent | b44001f0c35c71357de671925af59585fe44a345 (diff) | |
download | FreeBSD-src-66a17c64befa7b46733cddb36bb548fed0497276.zip FreeBSD-src-66a17c64befa7b46733cddb36bb548fed0497276.tar.gz |
Garbage-collected splmem.
Moved the declaration of malloc_mtx to be with the other extern declarations
and not exposed to userland.
Fixed some minor style bugs.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/malloc.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 9a46e92..b909d2e 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -41,9 +41,7 @@ #include <sys/_lock.h> #include <sys/_mutex.h> -#define splmem splhigh - -#define MINALLOCSIZE UMA_SMALLEST_UNIT +#define MINALLOCSIZE UMA_SMALLEST_UNIT /* * flags to malloc. @@ -52,7 +50,7 @@ #define M_NOWAIT 0x0001 /* do not block */ #define M_USE_RESERVE 0x0002 /* can alloc out of reserve memory */ #define M_ZERO 0x0004 /* bzero the allocation */ -#define M_NOVM 0x0008 /* Don't ask the VM for pages */ +#define M_NOVM 0x0008 /* don't ask VM for pages */ #define M_MAGIC 877983977 /* time when first defined :-) */ @@ -65,11 +63,9 @@ struct malloc_type { u_long ks_maxused; /* maximum number ever used */ u_long ks_magic; /* if it's not magic, don't touch it */ const char *ks_shortdesc; /* short description */ - struct mtx ks_mtx; /* Lock for stats */ + struct mtx ks_mtx; /* lock for stats */ }; -extern struct mtx malloc_mtx; - #ifdef _KERNEL #define MALLOC_DEFINE(type, shortdesc, longdesc) \ struct malloc_type type[1] = { \ @@ -102,6 +98,8 @@ MALLOC_DECLARE(M_IP6NDP); /* for INET6 */ */ MALLOC_DECLARE(M_IOV); +extern struct mtx malloc_mtx; + /* XXX struct malloc_type is unused for contig*(). */ void contigfree(void *addr, unsigned long size, struct malloc_type *type); void *contigmalloc(unsigned long size, struct malloc_type *type, int flags, |