[Xcb] [PATCH 1/2] Don't declare xcb_req as static

Adam Jackson ajax at redhat.com
Wed Jun 28 15:45:41 UTC 2017


Doing so forces the compiler to allocate storage for the symbol in
.data, which means 24 bytes of dirty data and a relocation per request
function.

   text	   data	    bss	    dec	    hex	filename
  88888	   7136	      8	  96032	  17720	src/.libs/libxcb-glx.so.before
  92432	    680	      8	  93120	  16bc0	src/.libs/libxcb-glx.so.after

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 src/c_client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/c_client.py b/src/c_client.py
index 57de3fb..3b61f35 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -2319,7 +2319,7 @@ def _c_request_helper(self, name, void, regular, aux=False, reply_fds=False):
     dimension = count + 2
 
     _c('{')
-    _c('    static const xcb_protocol_request_t xcb_req = {')
+    _c('    const xcb_protocol_request_t xcb_req = {')
     _c('        .count = %d,', count)
     _c('        .ext = %s,', func_ext_global)
     _c('        .opcode = %s,', self.c_request_name.upper())
-- 
2.13.0



More information about the Xcb mailing list