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

Unified Diff: runtime/platform/globals.h

Issue 9241008: Remove dependency from platform/globals.h to platform/assert.h (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 7f8beed655a92956d0f4ceda56c1468466173c5a..f866a7cff2e9ecfe6c5980f3df4168108a9485fc 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -40,13 +40,14 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <cstdlib>
+#include <sstream>
#if defined(_WIN32)
#include "platform/c99_support_win.h"
#include "platform/inttypes_support_win.h"
#endif
-
// Target OS detection.
// for more information on predefined macros:
// - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
@@ -192,10 +193,15 @@ private: \
// Macro to disallow allocation in the C++ heap. This should be used
-// in the private section for a class.
+// in the private section for a class. Don't use UNREACHABLE here to
+// avoid circular dependencies between platform/globals.h and
+// platform/assert.h.
#define DISALLOW_ALLOCATION() \
public: \
- void operator delete(void* pointer) { UNREACHABLE(); } \
+ void operator delete(void* pointer) { \
+ fprintf(stderr, "unreachable code\n"); \
+ std::abort(); \
+ } \
private: \
void* operator new(size_t size);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698