We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
internals_pp_manager
1 parent 4ef8b0c commit aa1c3aaCopy full SHA for aa1c3aa
include/pybind11/detail/internals.h
@@ -648,8 +648,16 @@ class internals_pp_manager {
648
/// Get the current pointer-to-pointer, allocating it if it does not already exist. May
649
/// acquire the GIL. Will never return nullptr.
650
std::unique_ptr<InternalsType> *get_pp() {
651
+#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
652
gil_scoped_acquire_simple gil;
653
return get_or_create_pp_in_state_dict();
654
+#else
655
+ if (!internals_singleton_pp_) {
656
+ gil_scoped_acquire_simple gil;
657
+ internals_singleton_pp_ = get_or_create_pp_in_state_dict();
658
+ }
659
+ return internals_singleton_pp_;
660
+#endif
661
}
662
663
/// Drop all the references we're currently holding.
0 commit comments