mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
4c9ea093cd
commit
f453221c8b
3 changed files with 13 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue