]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116029: Fix unused function warning on macOS (#116340)
authorSam Gross <colesbury@gmail.com>
Tue, 5 Mar 2024 03:06:21 +0000 (22:06 -0500)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2024 03:06:21 +0000 (22:06 -0500)
Objects/dictobject.c

index 39778df603f43f7dd1517aeec27bf80fe5e4dbf7..027cff1bfb451a345646fdfebc23c4b1ed1aaf0f 100644 (file)
@@ -1238,10 +1238,10 @@ start:
     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)