This is called by the _hzfunc macro if stack tracing is switched on. This adds the function called to the function stack of the hzProcess (the thread calling the function) Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hzProcess::PushFunction | (const char*,) |
Declared in file: hzProcess.h
Defined in file : hzProcess.cpp
Function Logic:
Function body:
void hzProcess::PushFunction (const char* funcname)
{
// Category: Diagnostics
//
// This is called by the _hzfunc macro if stack tracing is switched on. This adds the function called to the function stack of
// the hzProcess (the thread calling the function)
//
// Argument: funcname The name of the current function. This should be the fully qualified name if a class method
// Returns: None
if (m_nPeak < _hzGlobal_callStack_size)
{
// Plac function call in the stack
m_Stack[m_nFuncs] = funcname ;
m_Funcx[m_nFuncs] = m_nSeqCall ;
m_nFuncs++ ;
if (m_nFuncs > m_nPeak)
m_nPeak = m_nFuncs ;
}
if (m_Hist)
{
// Plac function call in the history
m_Hist[m_nCallOset].m_func = funcname ;
m_Hist[m_nCallOset].m_callNo = ++m_nSeqCall ;
if (m_nSeqCall == 0)
m_Hist[m_nCallOset].m_series++ ;
m_Hist[m_nCallOset].m_callLevel = m_nFuncs ;
m_nCallOset++ ;
if (m_nCallOset == _hzGlobal_callHist_size)
m_nCallOset = 0;
}
if (m_nFuncs == _hzGlobal_callStack_size)
{
// Stack is exceeded - terminate execution with a trace
StackTrace() ;
exit(200);
}
}