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

Function from_dump

include/boost/stacktrace/stacktrace.hpp:322–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320 /// @b Complexity: O(N)
321 template <class Char, class Trait>
322 static basic_stacktrace from_dump(std::basic_istream<Char, Trait>& in, const allocator_type& a = allocator_type()) {
323 typedef typename std::basic_istream<Char, Trait>::pos_type pos_type;
324 basic_stacktrace ret(0, 0, a);
325
326 // reserving space
327 const pos_type pos = in.tellg();
328 in.seekg(0, in.end);
329 const std::size_t frames_count = frames_count_from_buffer_size(static_cast<std::size_t>(in.tellg()));
330 in.seekg(pos);
331
332 if (!frames_count) {
333 return ret;
334 }
335
336 native_frame_ptr_t ptr = 0;
337 ret.impl_.reserve(frames_count);
338 while (in.read(reinterpret_cast<Char*>(&ptr), sizeof(ptr))) {
339 if (!ptr) {
340 break;
341 }
342
343 ret.impl_.push_back(frame(ptr));
344 }
345
346 return ret;
347 }
348
349 /// Constructs stacktrace from raw memory dump. Terminating zero frame is discarded.
350 ///

Callers 3

run_2Function · 0.85
test_inplaceFunction · 0.85
from_current_exceptionFunction · 0.85

Calls 1

frameClass · 0.70

Tested by 1

test_inplaceFunction · 0.68