Lines Matching refs:tp
1092 remove_temps(struct temp *tp)
1094 for (; tp != NULL; tp = tp->next)
1095 if (tp->pid == procpid)
1096 unlink(tp->tffn);
1598 struct temp *tp;
1606 tp = alloc(offsetof(struct temp, tffn[0]) + 14 + len, ap);
1608 tp->shf = NULL;
1609 tp->pid = procpid;
1610 tp->type = type;
1613 tp->tffn[0] = '\0';
1617 cp = (void *)tp;
1632 while ((i = open(tp->tffn, O_CREAT | O_EXCL | O_RDWR, 0600)) < 0) {
1657 tp->shf = shf_fdopen(i, SHF_WR, NULL);
1660 tp->next = *tlist;
1661 *tlist = tp;
1662 return (tp);
1677 tgrow(struct table *tp)
1681 struct tbl **ntblp, **otblp = tp->tbls;
1683 if (tp->tshift > 29)
1687 osize = (size_t)1 << (tp->tshift++);
1690 ntblp = alloc2(i, sizeof(struct tbl *), tp->areap);
1695 tp->nfree = (tp->tshift == 30) ? 0x3FFF0000UL :
1698 tp->tbls = ntblp;
1718 tp->nfree--;
1720 afree(tblp, tp->areap);
1723 afree(otblp, tp->areap);
1727 ktinit(Area *ap, struct table *tp, uint8_t initshift)
1729 tp->areap = ap;
1730 tp->tbls = NULL;
1731 tp->tshift = ((initshift > INIT_TBLSHIFT) ?
1733 tgrow(tp);
1738 ktscan(struct table *tp, const char *name, uint32_t h, struct tbl ***ppp)
1743 mask = ((size_t)1 << (tp->tshift)) - 1;
1751 pp = &tp->tbls[j & mask];
1763 ktenter(struct table *tp, const char *n, uint32_t h)
1769 if ((p = ktscan(tp, n, h, &pp)))
1772 if (tp->nfree == 0) {
1774 tgrow(tp);
1781 p = alloc(offsetof(struct tbl, name[0]) + ++len, tp->areap);
1784 p->areap = tp->areap;
1790 /* enter in tp->tbls */
1791 tp->nfree--;
1797 ktwalk(struct tstate *ts, struct table *tp)
1799 ts->left = (size_t)1 << (tp->tshift);
1800 ts->next = tp->tbls;
1824 ktsort(struct table *tp)
1833 i = (size_t)1 << (tp->tshift);
1835 sp = tp->tbls; /* source */