mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-111545: Add Py_HashPointer() function (#112096)
* Implement _Py_HashPointerRaw() as a static inline function. * Add Py_HashPointer() tests to test_capi.test_hash. * Keep _Py_HashPointer() function as an alias to Py_HashPointer().
This commit is contained in:
parent
f8852634ed
commit
828451dfde
9 changed files with 103 additions and 22 deletions
|
|
@ -49,3 +49,13 @@ See also the :c:member:`PyTypeObject.tp_hash` member.
|
|||
:pep:`456` "Secure and interchangeable hash algorithm".
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
|
||||
.. c:function:: Py_hash_t Py_HashPointer(const void *ptr)
|
||||
|
||||
Hash a pointer value: process the pointer value as an integer (cast it to
|
||||
``uintptr_t`` internally). The pointer is not dereferenced.
|
||||
|
||||
The function cannot fail: it cannot return ``-1``.
|
||||
|
||||
.. versionadded:: 3.13
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue