proxygen
folly::symbolizer::detail Namespace Reference

Functions

template<size_t N>
bool fixFrameArray (FrameArray< N > &fa, ssize_t n)
 

Detailed Description

Get stack trace into a given FrameArray, return true on success (and set frameCount to the actual frame count, which may be > N) and false on failure.

Function Documentation

template<size_t N>
bool folly::symbolizer::detail::fixFrameArray ( FrameArray< N > &  fa,
ssize_t  n 
)

Definition at line 87 of file Symbolizer.h.

References FOLLY_ALWAYS_INLINE, folly::symbolizer::FrameArray< N >::frameCount, folly::symbolizer::FrameArray< N >::frames, folly::symbolizer::getStackTrace(), and i.

Referenced by folly::symbolizer::getStackTrace(), and folly::symbolizer::getStackTraceSafe().

87  {
88  if (n != -1) {
89  fa.frameCount = n;
90  for (size_t i = 0; i < fa.frameCount; ++i) {
91  fa.frames[i].found = false;
92  }
93  return true;
94  } else {
95  fa.frameCount = 0;
96  return false;
97  }
98 }