| 98 | } |
| 99 | |
| 100 | BOOST_NOINLINE void init(std::size_t frames_to_skip, std::size_t max_depth) { |
| 101 | constexpr std::size_t buffer_size = 128; |
| 102 | if (!max_depth) { |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | BOOST_TRY { |
| 107 | { // Fast path without additional allocations |
| 108 | native_frame_ptr_t buffer[buffer_size]; |
| 109 | const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect(buffer, buffer_size < max_depth ? buffer_size : max_depth, frames_to_skip + 1); |
| 110 | if (buffer_size > frames_count || frames_count == max_depth) { |
| 111 | fill(buffer, frames_count); |
| 112 | return; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // Failed to fit in `buffer_size`. Allocating memory: |
| 117 | #ifdef BOOST_NO_CXX11_ALLOCATOR |
nothing calls this directly
no outgoing calls
no test coverage detected