10000 Caw/fix issue 131757 by mansidhall-CAW · Pull Request #1 · knacklabs/cpython · GitHub
[go: up one dir, main page]

Skip to content

Caw/fix issue 131757 #1

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
remove unnecessary atomics
  • Loading branch information
tom-pytel committed Mar 26, 2025
commit 68d14eaee615ae8927d4cb82d65ed31535952005
8 changes: 0 additions & 8 deletions Modules/_functoolsmodule.c
3885
Original file line number Diff line number Diff line change
Expand Up @@ -1312,11 +1312,7 @@ bounded_lru_cache_get_lock_held(lru_cache_object *self, PyObject *args, PyObject
lru_cache_extract_link(link);
lru_cache_append_link(self, link);
*result = link->result;
#ifdef Py_GIL_DISABLED
_Py_atomic_add_ssize(&self->hits, 1);
#else
self->hits++;
#endif
Py_INCREF(link->result);
Py_DECREF(key_);
return 1;
Expand All @@ -1325,11 +1321,7 @@ bounded_lru_cache_get_lock_held(lru_cache_object *self, PyObject *args, PyObject
Py_DECREF(key_);
return -1;
}
#ifdef Py_GIL_DISABLED
_Py_atomic_add_ssize(&self->misses, 1);
#else
self->misses++;
#endif
return 0;
}

Expand Down
0