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

Function alloc_unr_specific

freebsd/kern/subr_unit.c:763–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

761}
762
763int
764alloc_unr_specific(struct unrhdr *uh, u_int item)
765{
766 void *p1, *p2;
767 int i;
768
769 WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "alloc_unr_specific");
770
771 p1 = Malloc(sizeof(struct unr));
772 p2 = Malloc(sizeof(struct unr));
773
774 mtx_lock(uh->mtx);
775 i = alloc_unr_specificl(uh, item, &p1, &p2);
776 mtx_unlock(uh->mtx);
777
778 if (p1 != NULL)
779 Free(p1);
780 if (p2 != NULL)
781 Free(p2);
782
783 return (i);
784}
785
786/*
787 * Free a unr.

Callers 4

test_alloc_unr_specificFunction · 0.85
dmar_attachFunction · 0.85
ifc_alloc_unit_specificFunction · 0.85
tun_clone_createFunction · 0.85

Calls 3

alloc_unr_specificlFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by 1

test_alloc_unr_specificFunction · 0.68