summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-07-09 19:41:54 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-07-09 19:41:54 +0000
commit68e1f1589a694175c9ed40887f6a803c7ab3e69d (patch)
treea3ac1d7fb3242356613421fc18c3d30f5312f4d4 /sys
parent413195415205e807919dfe6a6c1604f720e8301c (diff)
Replace the huge MFREE macro with a simple call to m_free(). On today's
computer the resulting code is smaller and faster. Also remove the _MEXTREMOVE macro which was only used by MFREE. OK markus@ long time ago
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/mbuf.h32
1 files changed, 2 insertions, 30 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 6447a77c1d5..c00ee06cc11 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.89 2007/06/11 11:18:14 henning Exp $ */
+/* $OpenBSD: mbuf.h,v 1.90 2007/07/09 19:41:53 claudio Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -299,24 +299,6 @@ struct mbuf {
MCLINITREFERENCE(m); \
} while (/* CONSTCOND */ 0)
-#define _MEXTREMOVE(m) do { \
- if (MCLISREFERENCED(m)) { \
- _MCLDEREFERENCE(m); \
- } else if ((m)->m_flags & M_CLUSTER) { \
- pool_put(&mclpool, (m)->m_ext.ext_buf); \
- } else if ((m)->m_ext.ext_free) { \
- (*((m)->m_ext.ext_free))((m)->m_ext.ext_buf, \
- (m)->m_ext.ext_size, (m)->m_ext.ext_arg); \
- } else { \
- free((m)->m_ext.ext_buf,(m)->m_ext.ext_type); \
- } \
- (m)->m_flags &= ~(M_CLUSTER|M_EXT); \
- (m)->m_ext.ext_size = 0; /* why ??? */ \
-} while (/* CONSTCOND */ 0)
-
-#define MEXTREMOVE(m) \
- MBUFLOCK(_MEXTREMOVE((m));)
-
/*
* Reset the data pointer on an mbuf.
*/
@@ -337,17 +319,7 @@ do { \
* Free a single mbuf and associated external storage.
* Place the successor, if any, in n.
*/
-#define MFREE(m, n) \
- MBUFLOCK( \
- mbstat.m_mtypes[(m)->m_type]--; \
- if ((m)->m_flags & M_PKTHDR) \
- m_tag_delete_chain((m)); \
- if ((m)->m_flags & M_EXT) { \
- _MEXTREMOVE((m)); \
- } \
- (n) = (m)->m_next; \
- pool_put(&mbpool, (m)); \
- )
+#define MFREE(m, n) n = m_free((m))
/*
* Move just m_pkthdr from from to to,