8000 gh-128133: Added relaxed atomics to bytes_hash by abhijeetsharma200 · Pull Request #128412 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128133: Added relaxed atomics to bytes_hash #128412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
suppresed deprecated warnings
  • Loading branch information
abhijeetsharma200 committed Jan 2, 2025
commit af10ff1a68ecf031c179b398ce9a92b9d2f78be1
10 changes: 8 additions & 2 deletions Objects/bytesobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,28 @@
static inline void
set_ob_shash(PyBytesObject *a, Py_hash_t hash)
{
_Py_COMP_DIAG_PUSH
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
#ifdef Py_GIL_DISABLED
_Py_atomic_store_int_relaxed((int *)&a->ob_shash, (int)hash);
FT_ATOMIC_STORE_INT_RELAXED((int *)&a->ob_shash, (int)hash);

Check failure on line 61 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'&' requires l-value [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 61 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'function': 'int *' differs in levels of indirection from 'int **' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 61 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'_Py_atomic_store_int_relaxed': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 61 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'&' requires l-value [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 61 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'function': 'int *' differs in levels of indirection from 'int **' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 61 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'_Py_atomic_store_int_relaxed': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
#else
a->ob_shash = hash;
#endif
_Py_COMP_DIAG_POP
}

static inline Py_hash_t
get_ob_shash(PyBytesObject *a)
{
_Py_COMP_DIAG_PUSH
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
#ifdef Py_GIL_DISABLED
return (Py_hash_t)_Py_atomic_load_int_relaxed((int *)&a->ob_shash);
return (Py_hash_t)FT_ATOMIC_LOAD_INT_RELAXED((int *)&a->ob_shash);

Check failure on line 74 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'&' requires l-value [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 74 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'function': 'const int *' differs in levels of indirection from 'int **' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 74 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'_Py_atomic_load_int_relaxed': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 74 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'&' requires l-value [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 74 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'function': 'const int *' differs in levels of indirection from 'int **' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 74 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'_Py_atomic_load_int_relaxed': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
#else
return a->ob_shash;
#endif
_Py_COMP_DIAG_POP
}

Check warning on line 79 in Objects/bytesobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

control reaches end of non-void function [-Wreturn-type]


/*
Expand Down
Loading
0