File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ struct internals {
170
170
PyTypeObject *default_metaclass;
171
171
PyObject *instance_base;
172
172
#if defined(WITH_THREAD)
173
+ # if PYBIND11_INTERNALS_VERSION > 5
173
174
PYBIND11_TLS_KEY_INIT (tstate)
175
+ # endif // PYBIND11_INTERNALS_VERSION > 5
174
176
# if PYBIND11_INTERNALS_VERSION > 4
175
177
PYBIND11_TLS_KEY_INIT (loader_life_support_tls_key)
176
178
# endif // PYBIND11_INTERNALS_VERSION > 4
@@ -180,6 +182,7 @@ struct internals {
180
182
PYBIND11_TLS_FREE (loader_life_support_tls_key);
181
183
# endif // PYBIND11_INTERNALS_VERSION > 4
182
184
185
+ # if PYBIND11_INTERNALS_VERSION > 5
183
186
// This destructor is called *after* Py_Finalize() in finalize_interpreter().
184
187
// That *SHOULD BE* fine. The following details what happens when PyThread_tss_free is
185
188
// called. PYBIND11_TLS_FREE is PyThread_tss_free on python 3.7+. On older python, it does
@@ -188,6 +191,7 @@ struct internals {
188
191
// Neither of those have anything to do with CPython internals. PyMem_RawFree *requires*
189
192
// that the `tstate` be allocated with the CPython allocator.
190
193
PYBIND11_TLS_FREE (tstate);
194
+ # endif // PYBIND11_INTERNALS_VERSION > 5
191
195
}
192
196
#endif
193
197
};
You can’t perform that action at this time.
0 commit comments