diff options
author | 2020-05-12 18:46:20 +0200 | |
---|---|---|
committer | 2020-05-12 18:46:20 +0200 | |
commit | f453221c8b80e0570066a9375337f208d50e6406 (patch) | |
tree | 9ea682c978b6a302388c4df1b8174d5188e0b2d2 /Include/pyhash.h | |
parent | bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024) (diff) | |
download | cpython-f453221c8b80e0570066a9375337f208d50e6406.tar.gz cpython-f453221c8b80e0570066a9375337f208d50e6406.tar.bz2 cpython-f453221c8b80e0570066a9375337f208d50e6406.zip |
bpo-40602: Add _Py_HashPointerRaw() function (GH-20056)
Add a new _Py_HashPointerRaw() function which avoids replacing -1
with -2 to micro-optimize hash table using pointer keys: using
_Py_hashtable_hash_ptr() hash function.
Diffstat (limited to 'Include/pyhash.h')
-rw-r--r-- | Include/pyhash.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/pyhash.h b/Include/pyhash.h index 2f398589cee..4437b870332 100644 --- a/Include/pyhash.h +++ b/Include/pyhash.h @@ -9,6 +9,8 @@ extern "C" { #ifndef Py_LIMITED_API PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double); PyAPI_FUNC(Py_hash_t) _Py_HashPointer(const void*); +// Similar to _Py_HashPointer(), but don't replace -1 with -2 +PyAPI_FUNC(Py_hash_t) _Py_HashPointerRaw(const void*); PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t); #endif |