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

Unified Diff: include/core/SkPostConfig.h

Issue 83333005: Add SK_ALWAYS_INLINE. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: how do you spell judgment? Created 7 years, 1 month 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: include/core/SkPostConfig.h
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 1aff89953d9e576ecca98e16bf86471738f7826d..9ba199f2e9be25ba5c251fd6b1bd6b68ecdb2d94 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -379,6 +379,18 @@
#define SK_ATTR_DEPRECATED(msg) SK_ATTRIBUTE(deprecated)
#endif
+// If your judgment is better than the compiler's (i.e. you've profiled it),
+// you can use SK_ALWAYS_INLINE to force inlining. E.g.
+// inline void someMethod() { ... } // may not be inlined
+// SK_ALWAYS_INLINE void someMethod() { ... } // should always be inlined
+#if !defined(SK_ALWAYS_INLINE)
+# if defined(SK_BUILD_FOR_WIN)
+# define SK_ALWAYS_INLINE __forceinline
+# else
+# define SK_ALWAYS_INLINE SK_ATTRIBUTE(always_inline) inline
+# endif
+#endif
+
//////////////////////////////////////////////////////////////////////
#if defined(__clang__) || defined(__GNUC__)
« 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