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

Function zbuf_free

freebsd/net/bpf_zerocopy.c:139–150  ·  view source on GitHub ↗

* Free a zbuf, including its page array, sbufs, and pages. Allow partially * allocated zbufs to be freed so that it may be used even during a zbuf * setup. */

Source from the content-addressed store, hash-verified

137 * setup.
138 */
139static void
140zbuf_free(struct zbuf *zb)
141{
142 int i;
143
144 for (i = 0; i < zb->zb_numpages; i++) {
145 if (zb->zb_pages[i] != NULL)
146 zbuf_sfbuf_free(zb->zb_pages[i]);
147 }
148 free(zb->zb_pages, M_BPF);
149 free(zb, M_BPF);
150}
151
152/*
153 * Given a user pointer to a page of user memory, return an sf_buf for the

Callers 3

zbuf_setupFunction · 0.85
bpf_zerocopy_freeFunction · 0.85

Calls 2

zbuf_sfbuf_freeFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected