diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-10-17 20:54:53 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-10-17 20:54:53 (GMT) |
commit | 8f67d0893f7170986b0ad370844318544270cbcc (patch) | |
tree | 4aec6cf093d4d042d18d1fadc3ce52765d32bd8d /Include/pyport.h | |
parent | 6fb457526cef485d64f4f6744d81cae8c02032b3 (diff) | |
download | cpython-8f67d0893f7170986b0ad370844318544270cbcc.zip cpython-8f67d0893f7170986b0ad370844318544270cbcc.tar.gz cpython-8f67d0893f7170986b0ad370844318544270cbcc.tar.bz2 |
make hashes always the size of pointers; introduce Py_hash_t #9778
Diffstat (limited to 'Include/pyport.h')
-rw-r--r-- | Include/pyport.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index 5e98f0b..4331bf9 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -130,7 +130,7 @@ Used in: PY_LONG_LONG _PyHash_Double in Objects/object.c. Numeric hashes are based on reduction modulo the prime 2**_PyHASH_BITS - 1. */ -#if SIZEOF_LONG >= 8 +#if SIZEOF_VOID_P >= 8 #define _PyHASH_BITS 61 #else #define _PyHASH_BITS 31 @@ -177,6 +177,9 @@ typedef Py_intptr_t Py_ssize_t; # error "Python needs a typedef for Py_ssize_t in pyport.h." #endif +/* Py_hash_t is the same size as a pointer. */ +typedef Py_ssize_t Py_hash_t; + /* Largest possible value of size_t. SIZE_MAX is part of C99, so it might be defined on some platforms. If it is not defined, (size_t)-1 is a portable |