MCPcopy Create free account
hub / github.com/F-Stack/f-stack / m_align

Function m_align

freebsd/sys/mbuf.h:1136–1148  ·  view source on GitHub ↗

* Set the m_data pointer of a newly allocated mbuf to place an object of the * specified size at the end of the mbuf, longword aligned. * * NB: Historically, we had M_ALIGN(), MH_ALIGN(), and MEXT_ALIGN() as * separate macros, each asserting that it was called at the proper moment. * This required callers to themselves test the storage type and call the * right one. Rather than require call

Source from the content-addressed store, hash-verified

1134 * decisions, we centralize here.
1135 */
1136static __inline void
1137m_align(struct mbuf *m, int len)
1138{
1139#ifdef INVARIANTS
1140 const char *msg = "%s: not a virgin mbuf";
1141#endif
1142 int adjust;
1143
1144 KASSERT(m->m_data == M_START(m), (msg, __func__));
1145
1146 adjust = M_SIZE(m) - len;
1147 m->m_data += adjust &~ (sizeof(long)-1);
1148}
1149
1150#define M_ALIGN(m, len) m_align(m, len)
1151#define MH_ALIGN(m, len) m_align(m, len)

Callers 15

ieee80211_fragmentFunction · 0.50
icmp_errorFunction · 0.50
m_megapullupFunction · 0.50
key_sp2mbufFunction · 0.50
key_gather_mbufFunction · 0.50
key_spdexpireFunction · 0.50
key_setsadbsaFunction · 0.50
key_setsadbaddrFunction · 0.50
key_setsadbxsa2Function · 0.50
key_setsadbxsareplayFunction · 0.50
key_setsadbxtypeFunction · 0.50
key_setsadbxportFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected