diff options
| author | Victor Stinner <vstinner@python.org> | 2020-05-12 18:46:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-12 18:46:20 +0200 |
| commit | f453221c8b80e0570066a9375337f208d50e6406 (patch) | |
| tree | 9ea682c978b6a302388c4df1b8174d5188e0b2d2 /Include | |
| parent | 4c9ea093cd752a6687864674d34250653653f743 (diff) | |
| download | cpython-git-f453221c8b80e0570066a9375337f208d50e6406.tar.gz | |
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')
| -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 2f398589ce..4437b87033 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 |
