MCPcopy Create free account
hub / github.com/boostorg/stacktrace / init

Method init

include/boost/stacktrace/stacktrace.hpp:100–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected