mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-134891: Add PyUnstable_Unicode_GET_CACHED_HASH (GH-134892)
This commit is contained in:
parent
343182853f
commit
e413e26719
7 changed files with 55 additions and 5 deletions
|
@ -167,11 +167,7 @@ static inline void PyUnicode_SET_UTF8_LENGTH(PyObject *op, Py_ssize_t length)
|
|||
#define _PyUnicode_HASH(op) \
|
||||
(_PyASCIIObject_CAST(op)->hash)
|
||||
|
||||
static inline Py_hash_t PyUnicode_HASH(PyObject *op)
|
||||
{
|
||||
assert(_PyUnicode_CHECK(op));
|
||||
return FT_ATOMIC_LOAD_SSIZE_RELAXED(_PyASCIIObject_CAST(op)->hash);
|
||||
}
|
||||
#define PyUnicode_HASH PyUnstable_Unicode_GET_CACHED_HASH
|
||||
|
||||
static inline void PyUnicode_SET_HASH(PyObject *op, Py_hash_t hash)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue