From 906bb0b5515e0ad0f645bc7865ea4cdc74974795 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Fri, 16 Feb 2024 08:49:57 +0300 Subject: [PATCH] Add unignorable info on memory leaks for affected platforms (#150) --- src/from_exception.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/from_exception.cpp b/src/from_exception.cpp index 7f2de57..676a748 100644 --- a/src/from_exception.cpp +++ b/src/from_exception.cpp @@ -21,6 +21,23 @@ #if !BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING #include #include + +#ifndef BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK + +#ifdef BOOST_HAS_THREADS + +#error On this platform memory leaks are possible if capturing stacktrace from \ + exceptions is enabled and exceptions are thrown concurrently \ + and libc++ runtime is used. \ + \ + Define `BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK` to \ + suppress this error if the library would not be used with libc++ \ + runtime (for example, would be used with GCC's runtime). + +#endif + +#endif + #endif namespace {