aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-04-19 14:30:40 -0700
committerUlrich Sibiller <uli42@gmx.de>2016-10-10 22:58:33 +0200
commit670b8ef648e4bce8369fbf2dfbf4370e4e2d36be (patch)
treebc51858c4ddc5923bb5353dcbc19ab1b18f592c5 /nx-X11
parent6165dafdae0eaac74e46ffffb1ea85fcaa7a96a4 (diff)
downloadnx-libs-670b8ef648e4bce8369fbf2dfbf4370e4e2d36be.tar.gz
nx-libs-670b8ef648e4bce8369fbf2dfbf4370e4e2d36be.tar.bz2
nx-libs-670b8ef648e4bce8369fbf2dfbf4370e4e2d36be.zip
Give GNU & Solaris Studio compilers hints about XEatData branches
Try to offset the cost of all the recent checks we've added by giving the compiler a hint that the branches that involve us eating data are less likely to be used than the ones that process it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/Xlibint.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h
index cd972cfae..56c1f7b5e 100644
--- a/nx-X11/lib/X11/Xlibint.h
+++ b/nx-X11/lib/X11/Xlibint.h
@@ -870,6 +870,15 @@ typedef struct _XExten { /* private to extension mechanism */
struct _XExten *next_flush; /* next in list of those with flushes */
} _XExtension;
+/* Temporary definition until we can depend on an xproto release with it */
+#ifdef _X_COLD
+# define _XLIB_COLD _X_COLD
+#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */
+# define _XLIB_COLD __attribute__((__cold__))
+#else
+# define _XLIB_COLD /* nothing */
+#endif
+
/* extension hooks */
#ifdef DataRoutineIsProcedure
@@ -892,11 +901,14 @@ extern int (*_XErrorFunction)(
extern void _XEatData(
Display* /* dpy */,
unsigned long /* n */
-);
+) _XLIB_COLD;
extern void _XEatDataWords(
Display* /* dpy */,
unsigned long /* n */
-);
+) _XLIB_COLD;
+#if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */
+# pragma rarely_called(_XEatData, _XEatDataWords)
+#endif
extern char *_XAllocScratch(
Display* /* dpy */,
unsigned long /* nbytes */