1: /*
2: * Xhash is an array of HSHSIZ bits (HSHSIZ / 8 chars), which are used
3: * to hash execs. If it is allocated (havhash true), then to tell
4: * whether ``name'' is (possibly) present in the i'th component
5: * of the variable path, you look at the bit in xhash indexed by
6: * hash(hashname("name"), i). This is setup automatically
7: * after .login is executed, and recomputed whenever ``path'' is
8: * changed.
9: * The two part hash function is designed to let texec() call the
10: * more expensive hashname() only once and the simple hash() several
11: * times (once for each path component checked).
12: * Byte size is assumed to be 8.
13: */
14: #define HSHSIZ 8192 /* 1k bytes */
15: #define HSHMASK (HSHSIZ - 1)
16: #define HSHMUL 243
17: char xhash[HSHSIZ / 8];
18: #define hash(a, b) ((a) * HSHMUL + (b) & HSHMASK)
19: #define bit(h, b) ((h)[(b) >> 3] & 1 << ((b) & 7)) /* bit test */
20: #define bis(h, b) ((h)[(b) >> 3] |= 1 << ((b) & 7)) /* bit set */
21: #ifdef VFORK
22: int hits, misses;
23: #endif
Defined variables
hits
defined in line
22; used 6 times
xhash
defined in line
17; used 5 times
Defined macros
bis
defined in line
20; used 1 times
bit
defined in line
19; used 2 times
hash
defined in line
18; used 4 times
Usage of this include