diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-04-19 14:30:40 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-09 18:59:54 -0700 |
commit | 3fe4bea086149f06a142a8f1d575f627ec1e22c7 (patch) | |
tree | af9ab3d7fdd9a300cd0cf19be900947ad5b5fdb2 /include | |
parent | e1b457beb8d4e831ef44279dada6c475cb955738 (diff) |
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 'include')
-rw-r--r-- | include/X11/Xlibint.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index d63a5343..acbad6be 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -832,6 +832,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 @@ -854,11 +863,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 */ |