[Xcb] [PATCH] allow compile-time setting for XCB queue buffer size
Julien Danjou
julien at danjou.info
Fri Sep 26 11:14:50 PDT 2008
Signed-off-by: Julien Danjou <julien at danjou.info>
---
configure.ac | 11 +++++++++++
src/xcbint.h | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 062c0cb..e8a98cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,16 @@ linux*)
;;
esac
+dnl define buffer queue size
+xcb_queue_buffer_size=16384
+AC_DEFINE(XCB_QUEUE_BUFFER_SIZE, $xcb_queue_buffer_size, [XCB buffer queue size])
+AC_ARG_WITH(queue-size,
+ AC_HELP_STRING([--with-queue-size=SIZE],
+ [Set the XCB buffer queue size (default is 16384)]),
+ [AC_DEFINE_UNQUOTED(XCB_QUEUE_BUFFER_SIZE, $withval, [XCB buffer queue size]),
+ xcb_queue_buffer_size=$withval],
+ )
+
dnl check for the sockaddr_un.sun_len member
AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
[AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])],
@@ -183,6 +193,7 @@ echo ""
echo " Configuration"
echo " XDM support.........: ${have_xdmcp}"
echo " Build unit tests....: ${HAVE_CHECK}"
+echo " XCB buffer size.....: ${xcb_queue_buffer_size}"
echo ""
echo " Used CFLAGS:"
echo " CPPFLAGS............: ${CPPFLAGS}"
diff --git a/src/xcbint.h b/src/xcbint.h
index ab0264f..2bc6d33 100644
--- a/src/xcbint.h
+++ b/src/xcbint.h
@@ -72,7 +72,7 @@ typedef struct _xcb_out {
pthread_cond_t cond;
int writing;
- char queue[4096];
+ char queue[XCB_QUEUE_BUFFER_SIZE];
int queue_len;
unsigned int request;
@@ -99,7 +99,7 @@ typedef struct _xcb_in {
pthread_cond_t event_cond;
int reading;
- char queue[4096];
+ char queue[XCB_QUEUE_BUFFER_SIZE];
int queue_len;
unsigned int request_expected;
--
1.5.6.5
More information about the Xcb
mailing list