summaryrefslogtreecommitdiff
path: root/Xext/xace.h
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-11-06 16:26:09 -0500
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-11-06 16:26:09 -0500
commitd7c5e8bfc1aecbd23a4cbb2eab08656587aac2e8 (patch)
tree79cedf01ed0a533a9ab9611ae95f113159aab383 /Xext/xace.h
parentaaa50b64113b122aaebd46e3b78e3fb7a8d70500 (diff)
Modified performance patches from Arjan van de Ven <arjan@infradead.org>
Subject: [PATCH] fix some performance gaps in Xace The XaceHook function is used in several hotpaths. The problem with it (performance wise) is twofold: * The XaceHook function has a big switch() statement for the hook number in it * The XaceHook function uses varargs to reassemble the final dispatch arguments again Both are expensive operations... for something that is known at compile time This patch turns the hotpath XaceHook call into a direct call to avoid the switch and varargs; this gives me over 10% performance gain on the x11perf benchmark.
Diffstat (limited to 'Xext/xace.h')
-rw-r--r--Xext/xace.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Xext/xace.h b/Xext/xace.h
index 4143cd42f..273635c73 100644
--- a/Xext/xace.h
+++ b/Xext/xace.h
@@ -68,6 +68,11 @@ extern int XaceHook(
... /*appropriate args for hook*/
);
+/* Special-cased hook functions
+ */
+extern void XaceHookAuditEnd(ClientPtr ptr, int result);
+extern void XaceHookAuditBegin(ClientPtr ptr);
+
/* Register a callback for a given hook.
*/
#define XaceRegisterCallback(hook,callback,data) \
@@ -98,9 +103,13 @@ extern void XaceCensorImage(
#ifdef __GNUC__
#define XaceHook(args...) XaceAllowOperation
+#define XaceHookAuditEnd(args...) { ; }
+#define XaceHookAuditBegin(args...) { ; }
#define XaceCensorImage(args...) { ; }
#else
#define XaceHook(...) XaceAllowOperation
+#define XaceHookAuditEnd(...) { ; }
+#define XaceHookAuditBegin(...) { ; }
#define XaceCensorImage(...) { ; }
#endif