diff options
author | Adam Jackson <ajax@redhat.com> | 2011-12-13 21:00:05 -0500 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2012-01-18 11:37:36 -0800 |
commit | 800e2d1e724cbf4bbb1ab0b487c681ffce9a93f2 (patch) | |
tree | 016f25c1fba01c774e97b84bb2e6c2bb12082b04 | |
parent | f12ec33ae058ebf850d17c28f21411372db2c8f0 (diff) |
xace: ricer tuning for XaceHook
gcc doesn't want to hoist the check for XaceHooks[hook] != NULL above the
varargs code for some reason, so do it ourselves.
Before:
40000000 trep @ 0.0010 msec (1050420.2/sec): PutImage 10x10 square
60000000 trep @ 0.0005 msec (1921147.6/sec): ShmPutImage 10x10 square
After:
40000000 trep @ 0.0009 msec (1087458.5/sec): PutImage 10x10 square
60000000 trep @ 0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 11977fab546da35d579ebe285e3c26864007805e)
-rw-r--r-- | Xext/xace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Xext/xace.c b/Xext/xace.c index c757cad05..ef69fe363 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -101,6 +101,10 @@ int XaceHook(int hook, ...) } u; int *prv = NULL; /* points to return value from callback */ va_list ap; /* argument list */ + + if (!XaceHooks[hook]) + return Success; + va_start(ap, hook); /* Marshal arguments for passing to callback. |