Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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++;
Comment thread
tom-pytel marked this conversation as resolved.
Outdated
Comment thread
tom-pytel marked this conversation as resolved.
Outdated
#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++;
Comment thread
ZeroIntensity marked this conversation as resolved.
Outdated
Comment thread
tom-pytel marked this conversation as resolved.
Outdated
#endif
return 0;
}

Expand Down