Commit 1a503b27 authored by Sergei Golubchik's avatar Sergei Golubchik

don't flush dbug buffers for every assert

only do it before crashing.

Otherwise it introduces a noticable slowdown and,
most importantly, changes errno, when the caller
doesn't expect it.
parent c10fadb9
......@@ -102,8 +102,8 @@ extern const char* _db_get_func_(void);
#define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
#define DBUG_ASSERT(A) ( _db_flush_(), assert(A) )
#define DBUG_SLOW_ASSERT(A) ( _db_flush_(), assert(A) )
#define DBUG_ASSERT(A) do { if (!(A)) { _db_flush_(); assert(A); }} while (0)
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
#define DBUG_ASSERT_EXISTS
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment