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

Side by Side Diff: runtime/platform/globals.h

Issue 12340086: Force WriteByte to be inlined (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/datastream.h » ('j') | runtime/vm/datastream.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef PLATFORM_GLOBALS_H_ 5 #ifndef PLATFORM_GLOBALS_H_
6 #define PLATFORM_GLOBALS_H_ 6 #define PLATFORM_GLOBALS_H_
7 7
8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to 8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to
9 // enable platform independent printf format specifiers. 9 // enable platform independent printf format specifiers.
10 #ifndef __STDC_FORMAT_MACROS 10 #ifndef __STDC_FORMAT_MACROS
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // platform/assert.h. 264 // platform/assert.h.
265 #define DISALLOW_ALLOCATION() \ 265 #define DISALLOW_ALLOCATION() \
266 public: \ 266 public: \
267 void operator delete(void* pointer) { \ 267 void operator delete(void* pointer) { \
268 fprintf(stderr, "unreachable code\n"); \ 268 fprintf(stderr, "unreachable code\n"); \
269 abort(); \ 269 abort(); \
270 } \ 270 } \
271 private: \ 271 private: \
272 void* operator new(size_t size); 272 void* operator new(size_t size);
273 273
274 #ifdef _MSC_VER
Ivan Posva 2013/02/26 22:23:49 Please move this up next to the other toolchain de
275 #define DART_FORCE_INLINE __forceinline
276 #else
Ivan Posva 2013/02/26 22:23:49 You should not assume gcc if the compiler is not M
277 #define DART_FORCE_INLINE inline __attribute__((always_inline))
278 #endif
274 279
275 // The USE(x) template is used to silence C++ compiler warnings issued 280 // The USE(x) template is used to silence C++ compiler warnings issued
276 // for unused variables. 281 // for unused variables.
277 template <typename T> 282 template <typename T>
278 static inline void USE(T) { } 283 static inline void USE(T) { }
279 284
280 285
281 // Use implicit_cast as a safe version of static_cast or const_cast 286 // Use implicit_cast as a safe version of static_cast or const_cast
282 // for upcasting in the type hierarchy (i.e. casting a pointer to Foo 287 // for upcasting in the type hierarchy (i.e. casting a pointer to Foo
283 // to a pointer to SuperclassOfFoo or casting a pointer to Foo to 288 // to a pointer to SuperclassOfFoo or casting a pointer to Foo to
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods 425 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods
421 // have an implicit 'this' argument, the arguments of such methods 426 // have an implicit 'this' argument, the arguments of such methods
422 // should be counted from two, not one." 427 // should be counted from two, not one."
423 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ 428 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \
424 __attribute__((__format__(__printf__, string_index, first_to_check))) 429 __attribute__((__format__(__printf__, string_index, first_to_check)))
425 #else 430 #else
426 #define PRINTF_ATTRIBUTE(string_index, first_to_check) 431 #define PRINTF_ATTRIBUTE(string_index, first_to_check)
427 #endif 432 #endif
428 433
429 #endif // PLATFORM_GLOBALS_H_ 434 #endif // PLATFORM_GLOBALS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/datastream.h » ('j') | runtime/vm/datastream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698