From c02d2cd4ec0fdef028be5b11421ddc61157bef7b Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 22 Jul 2024 19:13:35 -0700 Subject: [PATCH] Restore smart_holder_poc.h as-is on smart_holder branch (i.e. undo `PYBIND11_SMART_HOLDER_PADDING`, which was meant for stress-testing only). --- include/pybind11/detail/smart_holder_poc.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/include/pybind11/detail/smart_holder_poc.h b/include/pybind11/detail/smart_holder_poc.h index 99aedc9ad8..89742ab27e 100644 --- a/include/pybind11/detail/smart_holder_poc.h +++ b/include/pybind11/detail/smart_holder_poc.h @@ -138,31 +138,15 @@ inline bool is_std_default_delete(const std::type_info &rtti_deleter) { || rtti_deleter == typeid(std::default_delete); } -// Meant to help detecting invalid `reinterpret_cast`s or similar. -#ifdef PYBIND11_SMART_HOLDER_PADDING_ON -# define PYBIND11_SMART_HOLDER_PADDING(N) int PADDING_##N##_[11] -#else -# define PYBIND11_SMART_HOLDER_PADDING(N) -#endif - struct smart_holder { - PYBIND11_SMART_HOLDER_PADDING(1); const std::type_info *rtti_uqp_del = nullptr; - PYBIND11_SMART_HOLDER_PADDING(2); std::shared_ptr vptr; - PYBIND11_SMART_HOLDER_PADDING(3); bool vptr_is_using_noop_deleter : 1; - PYBIND11_SMART_HOLDER_PADDING(4); bool vptr_is_using_builtin_delete : 1; - PYBIND11_SMART_HOLDER_PADDING(5); bool vptr_is_external_shared_ptr : 1; - PYBIND11_SMART_HOLDER_PADDING(6); bool is_populated : 1; - PYBIND11_SMART_HOLDER_PADDING(7); bool is_disowned : 1; - PYBIND11_SMART_HOLDER_PADDING(8); bool pointee_depends_on_holder_owner : 1; // SMART_HOLDER_WIP: See PR #2839. - PYBIND11_SMART_HOLDER_PADDING(9); // Design choice: smart_holder is movable but not copyable. smart_holder(smart_holder &&) = default;