mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-23 16:01:42 +00:00
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.
This commit is contained in:
parent
0e9857132a
commit
9ef246c682
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51167
@ -39,7 +39,6 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#define MALLOC_INSTANTIATE
|
|
||||||
#include <sys/malloc.h>
|
#include <sys/malloc.h>
|
||||||
#include <sys/mbuf.h>
|
#include <sys/mbuf.h>
|
||||||
#include <sys/vmmeter.h>
|
#include <sys/vmmeter.h>
|
||||||
@ -52,6 +51,10 @@
|
|||||||
#include <vm/pmap.h>
|
#include <vm/pmap.h>
|
||||||
#include <vm/vm_map.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 *));
|
static void kmeminit __P((void *));
|
||||||
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
|
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
|
||||||
|
|
||||||
|
@ -81,17 +81,9 @@ void malloc_uninit __P((void *));
|
|||||||
#define MALLOC_DECLARE(type) \
|
#define MALLOC_DECLARE(type) \
|
||||||
extern struct malloc_type type[1]
|
extern struct malloc_type type[1]
|
||||||
|
|
||||||
#ifdef MALLOC_INSTANTIATE
|
MALLOC_DECLARE(M_CACHE);
|
||||||
#define MALLOC_MAKE_TYPE(type, shortdesc, longdesc) \
|
MALLOC_DECLARE(M_DEVBUF);
|
||||||
MALLOC_DEFINE(type, shortdesc, longdesc)
|
MALLOC_DECLARE(M_TEMP);
|
||||||
#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");
|
|
||||||
#endif /* KERNEL */
|
#endif /* KERNEL */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user