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

Function selfdalloc

freebsd/kern/sys_generic.c:1734–1748  ·  view source on GitHub ↗

* Preallocate two selfds associated with 'cookie'. Some fo_poll routines * have two select sets, one for read and another for write. */

Source from the content-addressed store, hash-verified

1732 * have two select sets, one for read and another for write.
1733 */
1734static void
1735selfdalloc(struct thread *td, void *cookie)
1736{
1737 struct seltd *stp;
1738
1739 stp = td->td_sel;
1740 if (stp->st_free1 == NULL)
1741 stp->st_free1 = malloc(sizeof(*stp->st_free1), M_SELFD, M_WAITOK|M_ZERO);
1742 stp->st_free1->sf_td = stp;
1743 stp->st_free1->sf_cookie = cookie;
1744 if (stp->st_free2 == NULL)
1745 stp->st_free2 = malloc(sizeof(*stp->st_free2), M_SELFD, M_WAITOK|M_ZERO);
1746 stp->st_free2->sf_td = stp;
1747 stp->st_free2->sf_cookie = cookie;
1748}
1749
1750static void
1751selfdfree(struct seltd *stp, struct selfd *sfp)

Callers 3

selscanFunction · 0.85
pollscanFunction · 0.85
selsocketFunction · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected