From df54a82dab627f8e2b803af39f16b330ebac8a64 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 19 Jul 2024 20:05:53 -0700 Subject: [PATCH] Introduce PYBIND11_SMART_HOLDER_PADDING_ON (as the only way to turn on padding). --- include/pybind11/detail/smart_holder_poc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pybind11/detail/smart_holder_poc.h b/include/pybind11/detail/smart_holder_poc.h index 1db16b6d6..99aedc9ad 100644 --- a/include/pybind11/detail/smart_holder_poc.h +++ b/include/pybind11/detail/smart_holder_poc.h @@ -138,7 +138,8 @@ inline bool is_std_default_delete(const std::type_info &rtti_deleter) { || rtti_deleter == typeid(std::default_delete); } -#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] #else # define PYBIND11_SMART_HOLDER_PADDING(N)