diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-02-17 12:53:43 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-02-17 15:23:45 +0100 |
commit | d697c96178d13725470192d63bd4fa1c202d0d2e (patch) | |
tree | 70641051116f5d72070367c4c0cbf340e2fc5c1a /include | |
parent | 41ca0b7262ca52646e935e41a187c5742c3993bb (diff) |
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.lunak@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/diagnose_ex.h | 4 |
1 files changed, 4 insertions, 0 deletions
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 |