You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/01/26 23:51:47 UTC

svn commit: r1438982 - in /subversion/branches/fsfs-format7: configure.ac subversion/svn_private_config.hw

Author: stefan2
Date: Sat Jan 26 22:51:47 2013
New Revision: 1438982

URL: http://svn.apache.org/viewvc?rev=1438982&view=rev
Log:
On the fsfs-format7 branch:  Introduce a handful of SVN-private macros
that can help the compiler make better decisions about code layout.
The use of these macros is completely optional and will *never* change
the behavior of the code.

* configure.ac
  (AH_BOTTOM): expand to define SVN__PREDICT_FALSE, SVN__PREDICT_TRUE,
               SVN__FORCE_INLINE and SVN__PREVENT_INLINE

* subversion/svn_private_config.hw
  (SVN__PREDICT_FALSE,
   SVN__PREDICT_TRUE,
   SVN__FORCE_INLINE,
   SVN__PREVENT_INLINE): define them for Visual C 

Modified:
    subversion/branches/fsfs-format7/configure.ac
    subversion/branches/fsfs-format7/subversion/svn_private_config.hw

Modified: subversion/branches/fsfs-format7/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/configure.ac?rev=1438982&r1=1438981&r2=1438982&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/configure.ac (original)
+++ subversion/branches/fsfs-format7/configure.ac Sat Jan 26 22:51:47 2013
@@ -708,6 +708,26 @@ AH_BOTTOM([
 #define gettext(x) (x)
 #define dgettext(domain, x) (x)
 #endif
+
+/* compiler hints */
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+# define SVN__PREDICT_FALSE(x) (__builtin_expect(x, 0))
+# define SVN__PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
+#else
+# define SVN__PREDICT_FALSE(x)
+# define SVN__PREDICT_TRUE(x)
+#endif
+
+#if defined(SVN_DEBUG)
+# define SVN__FORCE_INLINE
+# define SVN__PREVENT_INLINE
+#elif defined(__GNUC__)
+# define SVN__FORCE_INLINE __attribute__ ((always_inline))
+# define SVN__PREVENT_INLINE __attribute__ ((noinline))
+#else
+# define SVN__FORCE_INLINE
+# define SVN__PREVENT_INLINE
+#endif
 ])
 
 dnl Used to simulate makefile conditionals.

Modified: subversion/branches/fsfs-format7/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn_private_config.hw?rev=1438982&r1=1438981&r2=1438982&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn_private_config.hw (original)
+++ subversion/branches/fsfs-format7/subversion/svn_private_config.hw Sat Jan 26 22:51:47 2013
@@ -101,6 +101,21 @@
 #define dgettext(domain, x) (x)
 #endif
 
+/* compiler hints as supported by MS VC */
+#if defined(SVN_DEBUG)
+# define SVN__FORCE_INLINE
+# define SVN__PREVENT_INLINE
+#elif define(_MSC_VER)
+# define SVN__FORCE_INLINE __forceinline
+# define SVN__PREVENT_INLINE __declspec(noinline)
+#else
+# define SVN__FORCE_INLINE
+# define SVN__PREVENT_INLINE
+#endif
+
+#define SVN__PREDICT_TRUE
+#define SVN__PREDICT_FALSE
+
 #endif /* SVN_PRIVATE_CONFIG_HW */
 
 /* Inclusion of Berkeley DB header */