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

Function new_unr

freebsd/kern/subr_unit.c:282–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280 */
281
282static __inline void *
283new_unr(struct unrhdr *uh, void **p1, void **p2)
284{
285 void *p;
286
287 uh->alloc++;
288 KASSERT(*p1 != NULL || *p2 != NULL, ("Out of cached memory"));
289 if (*p1 != NULL) {
290 p = *p1;
291 *p1 = NULL;
292 return (p);
293 } else {
294 p = *p2;
295 *p2 = NULL;
296 return (p);
297 }
298}
299
300static __inline void
301delete_unr(struct unrhdr *uh, void *ptr)

Callers 2

alloc_unr_specificlFunction · 0.85
free_unrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected