Commit 670b8ef6 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

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: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 6165dafd
...@@ -870,6 +870,15 @@ typedef struct _XExten { /* private to extension mechanism */ ...@@ -870,6 +870,15 @@ typedef struct _XExten { /* private to extension mechanism */
struct _XExten *next_flush; /* next in list of those with flushes */ struct _XExten *next_flush; /* next in list of those with flushes */
} _XExtension; } _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 */ /* extension hooks */
#ifdef DataRoutineIsProcedure #ifdef DataRoutineIsProcedure
...@@ -892,11 +901,14 @@ extern int (*_XErrorFunction)( ...@@ -892,11 +901,14 @@ extern int (*_XErrorFunction)(
extern void _XEatData( extern void _XEatData(
Display* /* dpy */, Display* /* dpy */,
unsigned long /* n */ unsigned long /* n */
); ) _XLIB_COLD;
extern void _XEatDataWords( extern void _XEatDataWords(
Display* /* dpy */, Display* /* dpy */,
unsigned long /* n */ unsigned long /* n */
); ) _XLIB_COLD;
#if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */
# pragma rarely_called(_XEatData, _XEatDataWords)
#endif
extern char *_XAllocScratch( extern char *_XAllocScratch(
Display* /* dpy */, Display* /* dpy */,
unsigned long /* nbytes */ unsigned long /* nbytes */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment