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

Function itimers_alloc

freebsd/kern/kern_time.c:1686–1707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686static void
1687itimers_alloc(struct proc *p)
1688{
1689 struct itimers *its;
1690 int i;
1691
1692 its = malloc(sizeof (struct itimers), M_SUBPROC, M_WAITOK | M_ZERO);
1693 LIST_INIT(&its->its_virtual);
1694 LIST_INIT(&its->its_prof);
1695 TAILQ_INIT(&its->its_worklist);
1696 for (i = 0; i < TIMER_MAX; i++)
1697 its->its_timers[i] = NULL;
1698 PROC_LOCK(p);
1699 if (p->p_itimers == NULL) {
1700 p->p_itimers = its;
1701 PROC_UNLOCK(p);
1702 }
1703 else {
1704 PROC_UNLOCK(p);
1705 free(its, M_SUBPROC);
1706 }
1707}
1708
1709/* Clean up timers when some process events are being triggered. */
1710static void

Callers 1

kern_ktimer_createFunction · 0.85

Calls 2

mallocFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected