https://github.com/python/cpython/commit/58c7919d05a360f3437a204960cddbeb78a71dce
commit: 58c7919d05a360f3437a204960cddbeb78a71dce
branch: main
author: Sam Gross <[email protected]>
committer: colesbury <[email protected]>
date: 2024-03-04T22:06:21-05:00
summary:

gh-116029: Fix unused function warning on macOS (#116340)

files:
M Objects/dictobject.c

diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 39778df603f43f..027cff1bfb451a 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1238,10 +1238,10 @@ _Py_dict_lookup(PyDictObject *mp, PyObject *key, 
Py_hash_t hash, PyObject **valu
     return ix;
 }
 
+#ifdef Py_GIL_DISABLED
 static inline void
 ensure_shared_on_read(PyDictObject *mp)
 {
-#ifdef Py_GIL_DISABLED
     if (!_Py_IsOwnedByCurrentThread((PyObject *)mp) && !IS_DICT_SHARED(mp)) {
         // The first time we access a dict from a non-owning thread we mark it
         // as shared. This ensures that a concurrent resize operation will
@@ -1253,8 +1253,8 @@ ensure_shared_on_read(PyDictObject *mp)
         }
         Py_END_CRITICAL_SECTION();
     }
-#endif
 }
+#endif
 
 static inline void
 ensure_shared_on_resize(PyDictObject *mp)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to