debug: seperate SCOPED_SANITY from CHECK_SANITY

the former is for checking immediately and a scope exit, the latter is
for checking immediately.
This commit is contained in:
Danny Robson 2018-04-24 15:12:09 +10:00
parent f5399450ab
commit c5d142ec9a

View File

@ -126,11 +126,15 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define CHECK_SANITY(A) \ #define SCOPED_SANITY(A) \
::util::debug::scoped_sanity PASTE(__scoped_sanity_checker,__LINE__) (A); \ ::util::debug::scoped_sanity PASTE(__scoped_sanity_checker,__LINE__) ((A)); \
(void)PASTE(__scoped_sanity_checker,__LINE__); (void)PASTE(__scoped_sanity_checker,__LINE__);
///////////////////////////////////////////////////////////////////////////////
#define CHECK_SANITY(A) CHECK(::util::debug::is_valid ((A)))
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define CHECK_EQ(A,B) do { \ #define CHECK_EQ(A,B) do { \
DEBUG_ONLY ( \ DEBUG_ONLY ( \