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

Function sbuf_delete

freebsd/kern/subr_sbuf.c:870–884  ·  view source on GitHub ↗

* Clear an sbuf, free its buffer if necessary. */

Source from the content-addressed store, hash-verified

868 * Clear an sbuf, free its buffer if necessary.
869 */
870void
871sbuf_delete(struct sbuf *s)
872{
873 int isdyn;
874
875 assert_sbuf_integrity(s);
876 /* don't care if it's finished or not */
877
878 if (SBUF_ISDYNAMIC(s))
879 SBFREE(s->s_buf);
880 isdyn = SBUF_ISDYNSTRUCT(s);
881 memset(s, 0, sizeof(*s));
882 if (isdyn)
883 SBFREE(s);
884}
885
886/*
887 * Check if an sbuf has been finished.

Callers 15

fletcher_4_paramFunction · 0.85
log_syseventFunction · 0.85
kstat_sysctl_ioFunction · 0.85
kstat_sysctl_rawFunction · 0.85
rules_to_stringFunction · 0.85
sysctl_mac_veriexec_dbFunction · 0.85
maybe_demoteFunction · 0.85
sysctl_ieee80211comsFunction · 0.85
sysctl_tcp_hc_listFunction · 0.85

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected