Chromium Code Reviews| Index: runtime/platform/assert.h |
| diff --git a/runtime/platform/assert.h b/runtime/platform/assert.h |
| index 3ad928c9296825d91c88eb9ec6dfce59ae8c9ff8..0e3e7148f8d597299eee6a598a78863b3f8622c4 100644 |
| --- a/runtime/platform/assert.h |
| +++ b/runtime/platform/assert.h |
| @@ -256,8 +256,13 @@ void DynamicAssertionHelper::NotNull(const T p) { |
| // DEBUG_ASSERT allows identifiers in condition to be undeclared in release |
| // mode. |
| -#define DEBUG_ASSERT(cond) \ |
| - if (!(cond)) dart::Assert(__FILE__, __LINE__).Fail("expected: %s", #cond); |
| +#define DEBUG_ASSERT(cond) ASSERT(cond) |
| + |
| +// SLOW_ASSERT is used for slow assertion code and disabled by default. |
| +#define SLOW_ASSERT(cond) \ |
| + do { \ |
| + if (FLAG_slow_assert) ASSERT(cond); \ |
|
Kevin Millikin (Google)
2012/10/01 10:53:25
Align the \. You can add something like
(defun m
zerny-google
2012/10/01 11:12:04
Done.
|
| + } while (false) |
| #else // if defined(DEBUG) |
| @@ -268,6 +273,8 @@ void DynamicAssertionHelper::NotNull(const T p) { |
| #define DEBUG_ASSERT(cond) |
| +#define SLOW_ASSERT(cond) |
|
Kevin Millikin (Google)
2012/10/01 10:53:25
This should probably just expand into ASSERT(cond)
zerny-google
2012/10/01 11:12:04
Well, in the case of the verification code, it's n
|
| + |
| // The COMPILE_ASSERT macro can be used to verify that a compile time |
| // expression is true. For example, you could use it to verify the |
| // size of a static array: |