summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-09-11 16:41:39 +0000
committerbde <bde@FreeBSD.org>1999-09-11 16:41:39 +0000
commitec1ed330ea849528059831d091267265414df4b9 (patch)
treecda756a4e48684c5e25347eff084a83edf22f448 /sys
parent83acb0b653e05c38bb6bea377e9856e8a3dd42ec (diff)
downloadFreeBSD-src-ec1ed330ea849528059831d091267265414df4b9.zip
FreeBSD-src-ec1ed330ea849528059831d091267265414df4b9.tar.gz
Get rid of MALLOC_INSTANTIATE and MALLOC_MAKE_TYPE(). Just handle the 3
malloc types declared in <sys/malloc.h> like other global malloc types.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_malloc.c5
-rw-r--r--sys/sys/malloc.h14
2 files changed, 7 insertions, 12 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 98098ad..56cff7f 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -39,7 +39,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#define MALLOC_INSTANTIATE
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/vmmeter.h>
@@ -52,6 +51,10 @@
#include <vm/pmap.h>
#include <vm/vm_map.h>
+MALLOC_DEFINE(M_CACHE, "namecache", "Dynamically allocated cache entries");
+MALLOC_DEFINE(M_DEVBUF, "devbuf", "device driver memory");
+MALLOC_DEFINE(M_TEMP, "temp", "misc temporary data buffers");
+
static void kmeminit __P((void *));
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index bf85c33..f1422d5 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -81,17 +81,9 @@ void malloc_uninit __P((void *));
#define MALLOC_DECLARE(type) \
extern struct malloc_type type[1]
-#ifdef MALLOC_INSTANTIATE
-#define MALLOC_MAKE_TYPE(type, shortdesc, longdesc) \
- MALLOC_DEFINE(type, shortdesc, longdesc)
-#else
-#define MALLOC_MAKE_TYPE(type, shortdesc, longdesc) \
- MALLOC_DECLARE(type)
-#endif
-
-MALLOC_MAKE_TYPE(M_CACHE, "namecache", "Dynamically allocated cache entries");
-MALLOC_MAKE_TYPE(M_DEVBUF, "devbuf", "device driver memory");
-MALLOC_MAKE_TYPE(M_TEMP, "temp", "misc temporary data buffers");
+MALLOC_DECLARE(M_CACHE);
+MALLOC_DECLARE(M_DEVBUF);
+MALLOC_DECLARE(M_TEMP);
#endif /* KERNEL */
/*
OpenPOWER on IntegriCloud