Skip to content

Commit 127e768

Browse files
committed
Remove inlining changes.
1 parent 77d8f43 commit 127e768

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

Include/internal/pycore_pystate.h

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,9 @@ PyAPI_FUNC(PyThreadState *) _PyThreadState_GetCurrent(void);
112112
The caller must hold the GIL.
113113
114114
See also PyThreadState_Get() and PyThreadState_GetUnchecked(). */
115-
116-
static PyThreadState*
117-
// Forcing this to be non-inlined is nice for finding where this is called often.
118-
#ifdef Py_DEBUG
119-
_Py_MAYBE_UNUSED Py_NO_INLINE
120-
#else
121-
inline
122-
#endif
115+
static inline PyThreadState*
123116
_PyThreadState_GET(void)
124117
{
125-
126118
#if !defined(Py_BUILD_CORE_MODULE)
127119
return _Py_tss_tstate;
128120
#else
@@ -212,13 +204,7 @@ _Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate)
212204
213205
See also PyInterpreterState_Get()
214206
and _PyGILState_GetInterpreterStateUnsafe(). */
215-
static _Py_MAYBE_UNUSED PyInterpreterState*
216-
#ifdef Py_DEBUG
217-
Py_NO_INLINE
218-
#else
219-
inline
220-
#endif
221-
_PyInterpreterState_GET(void) {
207+
static inline PyInterpreterState* _PyInterpreterState_GET(void) {
222208
#ifdef Py_DEBUG
223209
PyThreadState *tstate = _PyThreadState_GET();
224210
_Py_EnsureTstateNotNULL(tstate);

Include/pyport.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,5 @@ extern "C" {
667667
# define _Py_STACK_GROWS_DOWN 1
668668
#endif
669669

670-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
671-
// C23 standard attribute
672-
# define _Py_MAYBE_UNUSED [[maybe_unused]]
673-
#elif _Py__has_attribute(__unused__)
674-
# define _Py_MAYBE_UNUSED __attribute__((__unused__))
675-
#else
676-
# define _Py_MAYBE_UNUSED
677-
#endif
678670

679671
#endif /* Py_PYPORT_H */

0 commit comments

Comments
 (0)