Introduce PYBIND11_SMART_HOLDER_PADDING_ON (as the only way to turn on padding).

This commit is contained in:
Ralf W. Grosse-Kunstleve 2024-07-19 20:05:53 -07:00
parent 5566c63ebf
commit df54a82dab

View File

@ -138,7 +138,8 @@ inline bool is_std_default_delete(const std::type_info &rtti_deleter) {
|| rtti_deleter == typeid(std::default_delete<T const>); || rtti_deleter == typeid(std::default_delete<T const>);
} }
#if !defined(NDEBUG) || true // BAKEIN_WIP: Stress test. // 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] # define PYBIND11_SMART_HOLDER_PADDING(N) int PADDING_##N##_[11]
#else #else
# define PYBIND11_SMART_HOLDER_PADDING(N) # define PYBIND11_SMART_HOLDER_PADDING(N)