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

Function sbuf_extendsize

freebsd/kern/subr_sbuf.c:149–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147#endif
148
149static int
150sbuf_extendsize(int size)
151{
152 int newsize;
153
154 if (size < (int)SBUF_MAXEXTENDSIZE) {
155 newsize = SBUF_MINEXTENDSIZE;
156 while (newsize < size)
157 newsize *= 2;
158 } else {
159 newsize = roundup2(size, SBUF_MAXEXTENDINCR);
160 }
161 KASSERT(newsize >= size, ("%s: %d < %d\n", __func__, newsize, size));
162 return (newsize);
163}
164
165/*
166 * Extend an sbuf.

Callers 2

sbuf_extendFunction · 0.85
sbuf_newFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected