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.
This commit is contained in:
Sergei Golubchik 2017-08-28 15:33:03 +02:00
parent c10fadb9d9
commit 1a503b2786

View File

@ -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))