diff options
author | Victor Stinner <vstinner@python.org> | 2020-05-12 16:46:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 16:46:20 (GMT) |
commit | f453221c8b80e0570066a9375337f208d50e6406 (patch) | |
tree | 9ea682c978b6a302388c4df1b8174d5188e0b2d2 /Include/pyhash.h | |
parent | 4c9ea093cd752a6687864674d34250653653f743 (diff) | |
download | cpython-f453221c8b80e0570066a9375337f208d50e6406.zip cpython-f453221c8b80e0570066a9375337f208d50e6406.tar.gz cpython-f453221c8b80e0570066a9375337f208d50e6406.tar.bz2 |
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 2f39858..4437b87 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 |