xserver: Branch 'master' - 3 commits

Daniel Stone daniels at kemper.freedesktop.org
Mon Aug 4 15:18:44 PDT 2008


 Xext/mbufbf.c                         |    3 +--
 dix/events.c                          |    1 -
 dix/globals.c                         |    4 ++--
 dix/main.c                            |   12 ++----------
 exa/exa.c                             |    2 --
 exa/exa_migration.c                   |    2 --
 hw/kdrive/src/kdrive.c                |    1 -
 hw/kdrive/src/kdrive.h                |    3 +--
 hw/xfree86/dixmods/extmod/xf86vmode.c |    3 +--
 include/dix.h                         |    2 +-
 include/globals.h                     |    2 +-
 11 files changed, 9 insertions(+), 26 deletions(-)

New commits:
commit 277a74bcbb7d0a93c4f2e1de11daabd8c5f93ee8
Author: Tomas Carnecky <tom at dbservice.com>
Date:   Mon Aug 4 23:26:00 2008 +0300

    Redefine clients as a fixed array
    
    This removes yet another xalloc() each server generation. Also, I
    couldn't find the corresponding xfree() so I guess that used to be a
    memory leak there.

diff --git a/dix/globals.c b/dix/globals.c
index d3dd331..a9134c3 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -78,7 +78,7 @@ PtrCtrl defaultPointerControl = {
 	DEFAULT_PTR_THRESHOLD,
 	0};
 
-_X_EXPORT ClientPtr *clients;
+_X_EXPORT ClientPtr  clients[MAXCLIENTS];
 _X_EXPORT ClientPtr  serverClient;
 _X_EXPORT int  currentMaxClients;   /* current size of clients array */
 _X_EXPORT long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
diff --git a/dix/main.c b/dix/main.c
index c34bc8a..35e59bd 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -284,10 +284,7 @@ int main(int argc, char *argv[], char *envp[])
 	{
 	    CreateWellKnownSockets();
 	    InitProcVectors();
-	    clients = (ClientPtr *)xalloc(MAXCLIENTS * sizeof(ClientPtr));
-	    if (!clients)
-		FatalError("couldn't create client array");
-	    for (i=1; i<MAXCLIENTS; i++) 
+	    for (i=1; i<MAXCLIENTS; i++)
 		clients[i] = NullClient;
 	    serverClient = (ClientPtr)xalloc(sizeof(ClientRec));
 	    if (!serverClient)
diff --git a/include/dix.h b/include/dix.h
index 4b8a96e..64e3d78 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -119,7 +119,7 @@ typedef struct _Client *ClientPtr; /* also in misc.h */
 
 typedef struct _WorkQueue	*WorkQueuePtr;
 
-extern ClientPtr *clients;
+extern ClientPtr clients[MAXCLIENTS];
 extern ClientPtr serverClient;
 extern int currentMaxClients;
 extern char dispatchExceptionAtReset;
commit 5532d63488ec45953ff7f925cfb4f87adb3b04a0
Author: Tomas Carnecky <tom at dbservice.com>
Date:   Mon Aug 4 23:06:08 2008 +0300

    Redefine WindowTable as a fixed array
    
    Instead of xalloc'ing it every server generation. The array is always
    the same size (MAXSCREENS), anyway.

diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c
index afa6177..e929ab5 100644
--- a/Xext/mbufbf.c
+++ b/Xext/mbufbf.c
@@ -47,6 +47,7 @@ in this Software without prior written authorization from The Open Group.
 #include "gcstruct.h"
 #include "inputstr.h"
 #include "validate.h"
+#include "globals.h"
 #include <sys/time.h>
 
 #define _MULTIBUF_SERVER_	/* don't want Xlib structures */
@@ -199,8 +200,6 @@ static Bool bufChangeWindowAttributes();
 static void bufClearToBackground();
 static void bufCopyWindow();
 
-extern WindowPtr *WindowTable;
-
 static Bool
 bufMultibufferInit(pScreen, pMBScreen)
     ScreenPtr pScreen;
diff --git a/dix/events.c b/dix/events.c
index d6b3ecb..f04433b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -150,7 +150,6 @@ typedef const char *string;
 #endif
 
 #ifdef XEVIE
-extern WindowPtr *WindowTable;
 extern int       xevieFlag;
 extern int       xevieClientIndex;
 extern DeviceIntPtr     xeviemouse;
diff --git a/dix/globals.c b/dix/globals.c
index 210c784..d3dd331 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -83,7 +83,7 @@ _X_EXPORT ClientPtr  serverClient;
 _X_EXPORT int  currentMaxClients;   /* current size of clients array */
 _X_EXPORT long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
 
-_X_EXPORT WindowPtr *WindowTable;
+_X_EXPORT WindowPtr WindowTable[MAXSCREENS];
 
 _X_EXPORT unsigned long globalSerialNumber = 0;
 _X_EXPORT unsigned long serverGeneration = 0;
diff --git a/dix/main.c b/dix/main.c
index ab6ca57..c34bc8a 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -305,9 +305,6 @@ int main(int argc, char *argv[], char *envp[])
 	SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]);
 	screenInfo.arraySize = MAXSCREENS;
 	screenInfo.numScreens = 0;
-	WindowTable = (WindowPtr *)xalloc(MAXSCREENS * sizeof(WindowPtr));
-	if (!WindowTable)
-	    FatalError("couldn't create root window table");
 
 	InitAtoms();
 	InitEvents();
@@ -417,7 +414,7 @@ int main(int argc, char *argv[], char *envp[])
 
         config_fini();
 
-        memset(WindowTable, 0, MAXSCREENS * sizeof(WindowPtr));
+        memset(WindowTable, 0, sizeof(WindowTable));
 	CloseDownDevices();
 	CloseDownEvents();
 
@@ -431,8 +428,6 @@ int main(int argc, char *argv[], char *envp[])
 	    xfree(screenInfo.screens[i]);
 	    screenInfo.numScreens = i;
 	}
-	xfree(WindowTable);
-	WindowTable = NULL;
 	FreeFonts();
 
 	FreeAuditTimer();
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index e31cc25..754b942 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -93,7 +93,6 @@ static Bool         kdCaughtSignal = FALSE;
  */
 
 KdOsFuncs	*kdOsFuncs;
-extern WindowPtr *WindowTable;
 
 void
 KdSetRootClip (ScreenPtr pScreen, BOOL enable)
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index e3878e2..3987cb0 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -43,13 +43,12 @@
 #include "fboverlay.h"
 #include "shadow.h"
 #include "randrstr.h"
+#include "globals.h"
 
 #ifdef XKB
 #include <X11/extensions/XKBstr.h>
 #endif
 
-extern WindowPtr    *WindowTable;
-
 #define KD_DPMS_NORMAL	    0
 #define KD_DPMS_STANDBY	    1
 #define KD_DPMS_SUSPEND	    2
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 91d5865..559f18b 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -48,6 +48,7 @@ from Kaleb S. KEITHLEY
 #include "swaprep.h"
 #include "xf86.h"
 #include "vidmodeproc.h"
+#include "globals.h"
 
 #define DEFAULT_XF86VIDMODE_VERBOSITY	3
 
@@ -122,8 +123,6 @@ static void SXF86VidModeNotifyEvent();
     xXF86VidModeNotifyEvent * /* to */
 );
 
-extern WindowPtr *WindowTable;
-
 static RESTYPE EventType;	/* resource type for event masks */
 
 typedef struct _XF86VidModeEvent *XF86VidModeEventPtr;
diff --git a/include/globals.h b/include/globals.h
index a95096f..607bc48 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -20,7 +20,7 @@ extern int monitorResolution;
 extern int defaultColorVisualClass;
 
 extern Bool Must_have_memory;
-extern WindowPtr *WindowTable;
+extern WindowPtr WindowTable[MAXSCREENS];
 extern int GrabInProgress;
 extern Bool noTestExtensions;
 
commit e882ee7056f370e0619d137b4ec3973ecb4e3479
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Tue Jul 29 17:52:11 2008 +0300

    EXA: Remove unnecessary #includes
    
    There wasn't actually any font code here, so no problem.

diff --git a/exa/exa.c b/exa/exa.c
index 48352bd..b8294bb 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -35,8 +35,6 @@
 #include <stdlib.h>
 
 #include "exa_priv.h"
-#include <X11/fonts/fontstruct.h>
-#include "dixfontstr.h"
 #include "exa.h"
 #include "cw.h"
 
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 3c79f68..25ea73d 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -33,8 +33,6 @@
 #include <string.h>
 
 #include "exa_priv.h"
-#include <X11/fonts/fontstruct.h>
-#include "dixfontstr.h"
 #include "exa.h"
 #include "cw.h"
 


More information about the xorg-commit mailing list