Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Unified Diff: runtime/vm/assert.h

Issue 11014013: Added slow_assert macro and flag for slow development assertions in the VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assert.h
diff --git a/runtime/vm/assert.h b/runtime/vm/assert.h
new file mode 100644
index 0000000000000000000000000000000000000000..7985bc5528f26beff67a9a689842e7b50b054192
--- /dev/null
+++ b/runtime/vm/assert.h
@@ -0,0 +1,24 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
siva 2012/10/01 23:35:40 I think it is not a good idea to add this file as
+
+#ifndef VM_ASSERT_H_
+#define VM_ASSERT_H_
+
+#include "platform/assert.h"
+#include "vm/flags.h"
+
+namespace dart {
+
+DECLARE_FLAG(bool, slow_asserts);
+
+// SLOW_ASSERT is used for slow assertion code and disabled by default.
+#if defined(DEBUG)
+#define SLOW_ASSERT(cond) ASSERT(!FLAG_slow_asserts || (cond))
+#else
+#define SLOW_ASSERT(cond)
+#endif
siva 2012/10/01 23:35:40 I don't quite understand the need for a VM wide SL
+
+} // namespace dart
+
+#endif // VM_ASSERT_H_
« no previous file with comments | « runtime/platform/assert.h ('k') | runtime/vm/compiler.cc » ('j') | runtime/vm/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698