[#BloombergLP-balst-StackTraceUtil-loadStackTraceFromStack]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balst.adoc[balst]::xref:BloombergLP/balst/StackTraceUtil.adoc[StackTraceUtil]::loadStackTraceFromStack
:relfileprefix: ../../../
:mrdocs:

Populate the specified `result` object with information about the current thread&apos;s program stack&period; Optionally specify `maxFrames` to indicate the maximum number of frames to take from the top of the stack&period; If `maxFrames` is not specified, the default limit is at least 1024&period; Optionally specify `demanglingPreferredFlag` to indicate whether to attempt to perform demangling, if possible&period; If `demanglingPreferredFlag` is not specfied, demangling is assumed to be preferred, however, demangling is always performed on the Windows platform and never performed on Solaris using the CC compiler regardless of the value of `demanglingPreferredFlag`&period; Any frames previously contained in the `stackTrace` object are discarded&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The behavior is undefined unless `maxFrames` (if specified) is greater than 0&period; Note that demangling may involve calling `malloc`&period;

== Synopsis

Declared in `&lt;balst&lowbar;stacktraceutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
loadStackTraceFromStack(
    xref:BloombergLP/balst/StackTrace.adoc[StackTrace]* result,
    int maxFrames = &hyphen;1,
    bool demanglingPreferredFlag = true);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
