Zero  0.1.0
lock_compt.h
Go to the documentation of this file.
1 /*
2  * (c) Copyright 2011-2013, Hewlett-Packard Development Company, LP
3  */
4 
5 #ifndef __LOCK_COMPT_H
6 #define __LOCK_COMPT_H
7 
12 // use this to compute highest prime #
13 // less that requested hash table size.
14 // Actually, it uses the highest prime less
15 // than the next power of 2 larger than the
16 // number requested. Lowest allowable
17 // hash table option size is 64.
18 
19 static const uint32_t primes[] = {
20  /* 0x40, 64, 2**6 */ 61,
21  /* 0x80, 128, 2**7 */ 127,
22  /* 0x100, 256, 2**8 */ 251,
23  /* 0x200, 512, 2**9 */ 509,
24  /* 0x400, 1024, 2**10 */ 1021,
25  /* 0x800, 2048, 2**11 */ 2039,
26  /* 0x1000, 4096, 2**12 */ 4093,
27  /* 0x2000, 8192, 2**13 */ 8191,
28  /* 0x4000, 16384, 2**14 */ 16381,
29  /* 0x8000, 32768, 2**15 */ 32749,
30  /* 0x10000, 65536, 2**16 */ 65521,
31  /* 0x20000, 131072, 2**17 */ 131071,
32  /* 0x40000, 262144, 2**18 */ 262139,
33  /* 0x80000, 524288, 2**19 */ 524287,
34  /* 0x100000, 1048576, 2**20 */ 1048573,
35  /* 0x200000, 2097152, 2**21 */ 2097143,
36  /* 0x400000, 4194304, 2**22 */ 4194301,
37  /* 0x800000, 8388608, 2**23 */ 8388593
38 };
39 
40 #endif // __LOCK_COMPT_H
static const uint32_t primes[]
Definition: lock_compt.h:19