Skip to content

Commit 906bb0b

Browse files
authored
Add unignorable info on memory leaks for affected platforms (#150)
1 parent 87ef7f6 commit 906bb0b

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/from_exception.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@
2121
#if !BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING
2222
#include <mutex>
2323
#include <unordered_map>
24+
25+
#ifndef BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK
26+
27+
#ifdef BOOST_HAS_THREADS
28+
29+
#error On this platform memory leaks are possible if capturing stacktrace from \
30+
exceptions is enabled and exceptions are thrown concurrently \
31+
and libc++ runtime is used. \
32+
\
33+
Define `BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK` to \
34+
suppress this error if the library would not be used with libc++ \
35+
runtime (for example, would be used with GCC's runtime).
36+
37+
#endif
38+
39+
#endif
40+
2441
#endif
2542
2643
namespace {

0 commit comments

Comments
 (0)