include/tools/diagnose_ex.h | 4 ++++ 1 file changed, 4 insertions(+) New commits: commit d697c96178d13725470192d63bd4fa1c202d0d2e Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Thu Feb 17 12:53:43 2022 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Thu Feb 17 15:23:45 2022 +0100
make DBG_UNHANDLED_EXCEPTION no-op if SAL_LOG_WARN is not enabled ee0e19296b959b4545b094f49a8b0c0b5463 make the macro unconditional, but that means it calls both DbgUnhandledException() and DbgGetCaughtException(), and then log it as SAL_WARN that's a no-op. With the document from tdf#105036 it added ~13% CPU time. Change-Id: I9360169e6e3976d40271bc5602765e56f58971d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130069 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index 530af9d6efe1..cf25a98565b0 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -57,6 +57,7 @@ inline css::uno::Any DbgGetCaughtException() handling is not correct... This takes two optional parameters: area and explanatory */ +#if defined SAL_LOG_WARN #define DBG_UNHANDLED_EXCEPTION_0_ARGS() \ DbgUnhandledException( DbgGetCaughtException(), __func__, SAL_DETAIL_WHERE ); #define DBG_UNHANDLED_EXCEPTION_1_ARGS(area) \ @@ -70,6 +71,9 @@ inline css::uno::Any DbgGetCaughtException() #define DBG_UNHANDLED_NO_ARG_EXPANDER() ,,DBG_UNHANDLED_EXCEPTION_0_ARGS #define DBG_UNHANDLED_MACRO_CHOOSER(...) DBG_UNHANDLED_CHOOSE_FROM_ARG_COUNT(DBG_UNHANDLED_NO_ARG_EXPANDER __VA_ARGS__ ()) #define DBG_UNHANDLED_EXCEPTION(...) DBG_UNHANDLED_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__) +#else // SAL_LOG_WARN +#define DBG_UNHANDLED_EXCEPTION(...) +#endif /** This macro asserts the given condition (in debug mode), and throws