/* Do not include univ.i because univ.i includes this. */
/*************************************************************//**
Report a failed assertion. */
ATTRIBUTE_NORETURN ATTRIBUTE_COLD __attribute__((nonnull(2))) void
ut_dbg_assertion_failed( /*====================*/ constchar* expr, /*!< in: the failed assertion */ constchar* file, /*!< in: source file containing the assertion */ unsigned line); /*!< in: line number of the assertion */
/** Abort execution if EXPR does not evaluate to nonzero.
@param EXPR assertion expression that should hold */ #define ut_a(EXPR) do { \ if (UNIV_UNLIKELY(!(ulint) (EXPR))) { \
ut_dbg_assertion_failed(#EXPR, \
__FILE__, __LINE__); \
} \
} while (0)
/** A "chronometer" used to clock snippets of code. Exampleusage: ut_chrono_tch("thisloop"); for(;;){...} ch.show();
would print the timings of the for() loop, prefixed with "this loop:" */ class ut_chrono_t { public: /** Constructor.
@param[in] name chrono's name, used when showing the values */
ut_chrono_t( constchar* name)
:
m_name(name),
m_show_from_destructor(true)
{
reset();
}
/** Resets the chrono (records the current time in it). */ void
reset()
{
gettimeofday(&m_tv, NULL);
getrusage(RUSAGE_SELF, &m_ru);
}
/** Shows the time elapsed and usage statistics since the last reset. */ void
show()
{ struct rusage ru_now; struct timeval tv_now; struct timeval tv_diff;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.