Debian Codegraph @

pypy/module/cpyext/include/pyhash.h

raw symbols SCIP
1 #ifndef Py_HASH_H
2
3 #define Py_HASH_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 /* Keep synced with rpython/rlib/objectmodel.py */
9
10 /* Prime multiplier used in string and various other hashes. */
11 #define _PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */
12
13 /* Parameters used for the numeric hash implementation. See notes for
14 _Py_HashDouble in Python/pyhash.c. Numeric hashes are based on
15 reduction modulo the prime 2**_PyHASH_BITS - 1. */
16
17 #if SIZEOF_VOID_P >= 8
18 # define _PyHASH_BITS 61
19 #else
20 # define _PyHASH_BITS 31
21 #endif
22
23 #define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
24 #define _PyHASH_INF 314159
25 #define _PyHASH_NAN 0
26 #define _PyHASH_IMAG _PyHASH_MULTIPLIER
27
28
29 #ifdef __cplusplus
30 }
31 #endif
32
33 #endif /* !Py_HASH_H */