Skip to content

Commit 0509a17

Browse files
Used ssize instead of int in atomics
1 parent 7405c5b commit 0509a17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/bytesobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ set_ob_shash(PyBytesObject *a, Py_hash_t hash)
5757
_Py_COMP_DIAG_PUSH
5858
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
5959
#ifdef Py_GIL_DISABLED
60-
_Py_atomic_store_int_relaxed((int *)&a->ob_shash, (int)hash);
60+
_Py_atomic_store_ssize_relaxed(&a->ob_shash, hash);
6161
#else
6262
a->ob_shash = hash;
6363
#endif
@@ -70,7 +70,7 @@ get_ob_shash(PyBytesObject *a)
7070
_Py_COMP_DIAG_PUSH
7171
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
7272
#ifdef Py_GIL_DISABLED
73-
return (Py_hash_t)_Py_atomic_load_int_relaxed((int *)&a->ob_shash);
73+
return _Py_atomic_load_ssize_relaxed(&a->ob_shash);
7474
#else
7575
return a->ob_shash;
7676
#endif

0 commit comments

Comments
 (0)