xserver: Branch 'xorg-server-1.4-apple' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Tue Nov 20 16:26:19 PST 2007


 dix/dispatch.c |   30 +++++++++++++++---------------
 dix/dixfonts.c |    4 ++--
 2 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit e261f829e423547b719a25f8773ee249c1f84adb
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Tue Nov 20 16:15:59 2007 -0800

    DIX: Remove remaining alloca calls

diff --git a/dix/dispatch.c b/dix/dispatch.c
index b4e8787..1cb0423 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -406,7 +406,7 @@ Dispatch(void)
     InitSelections();
     nClients = 0;
 
-    clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients);
+    clientReady = (int *) xalloc(sizeof(int) * MaxClients);
     if (!clientReady)
 	return;
 
@@ -535,7 +535,7 @@ Dispatch(void)
     ddxBeforeReset ();
 #endif
     KillAllClients();
-    DEALLOCATE_LOCAL(clientReady);
+    xfree(clientReady);
     dispatchException &= ~DE_RESET;
 #ifdef XSERVER_DTRACE
     FreeRequestNames();
@@ -919,7 +919,7 @@ ProcQueryTree(ClientPtr client)
     {
 	int curChild = 0;
 
-	childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window));
+	childIDs = (Window *) xalloc(numChildren * sizeof(Window));
 	if (!childIDs)
 	    return BadAlloc;
 	for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
@@ -934,7 +934,7 @@ ProcQueryTree(ClientPtr client)
     {
     	client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
 	WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
-	DEALLOCATE_LOCAL(childIDs);
+	xfree(childIDs);
     }
 
     return(client->noClientException);
@@ -2619,7 +2619,7 @@ ProcListInstalledColormaps(ClientPtr client)
         return rc;
 
     preply = (xListInstalledColormapsReply *) 
-		ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) +
+		xalloc(sizeof(xListInstalledColormapsReply) +
 		     pWin->drawable.pScreen->maxInstalledCmaps *
 		     sizeof(Colormap));
     if(!preply)
@@ -2634,7 +2634,7 @@ ProcListInstalledColormaps(ClientPtr client)
     WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply);
     client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
     WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
-    DEALLOCATE_LOCAL(preply);
+    xfree(preply);
     return(client->noClientException);
 }
 
@@ -2761,7 +2761,7 @@ ProcAllocColorCells (ClientPtr client)
 	}
 	nmasks = stuff->planes;
 	length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
-	ppixels = (Pixel *)ALLOCATE_LOCAL(length);
+	ppixels = (Pixel *)xalloc(length);
 	if(!ppixels)
             return(BadAlloc);
 	pmasks = ppixels + npixels;
@@ -2769,7 +2769,7 @@ ProcAllocColorCells (ClientPtr client)
 	if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, 
 				    (Bool)stuff->contiguous, ppixels, pmasks)) )
 	{
-	    DEALLOCATE_LOCAL(ppixels);
+	    xfree(ppixels);
             if (client->noClientException != Success)
                 return(client->noClientException);
 	    else
@@ -2788,7 +2788,7 @@ ProcAllocColorCells (ClientPtr client)
 	    client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
 	    WriteSwappedDataToClient(client, length, ppixels);
 	}
-	DEALLOCATE_LOCAL(ppixels);
+	xfree(ppixels);
         return (client->noClientException);        
     }
     else
@@ -2829,7 +2829,7 @@ ProcAllocColorPlanes(ClientPtr client)
 	acpr.sequenceNumber = client->sequence;
 	acpr.nPixels = npixels;
 	length = (long)npixels * sizeof(Pixel);
-	ppixels = (Pixel *)ALLOCATE_LOCAL(length);
+	ppixels = (Pixel *)xalloc(length);
 	if(!ppixels)
             return(BadAlloc);
 	if( (retval = AllocColorPlanes(client->index, pcmp, npixels,
@@ -2837,7 +2837,7 @@ ProcAllocColorPlanes(ClientPtr client)
 	    (Bool)stuff->contiguous, ppixels,
 	    &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
 	{
-            DEALLOCATE_LOCAL(ppixels);
+            xfree(ppixels);
             if (client->noClientException != Success)
                 return(client->noClientException);
 	    else
@@ -2852,7 +2852,7 @@ ProcAllocColorPlanes(ClientPtr client)
 	    client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
 	    WriteSwappedDataToClient(client, length, ppixels);
 	}
-	DEALLOCATE_LOCAL(ppixels);
+	xfree(ppixels);
         return (client->noClientException);        
     }
     else
@@ -2981,12 +2981,12 @@ ProcQueryColors(ClientPtr client)
 	xQueryColorsReply	qcr;
 
 	count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
-	prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb));
+	prgbs = (xrgb *)xalloc(count * sizeof(xrgb));
 	if(!prgbs && count)
             return(BadAlloc);
 	if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) )
 	{
-   	    if (prgbs) DEALLOCATE_LOCAL(prgbs);
+   	    if (prgbs) xfree(prgbs);
 	    if (client->noClientException != Success)
                 return(client->noClientException);
 	    else
@@ -3005,7 +3005,7 @@ ProcQueryColors(ClientPtr client)
 	    client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
 	    WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
 	}
-	if (prgbs) DEALLOCATE_LOCAL(prgbs);
+	if (prgbs) xfree(prgbs);
 	return(client->noClientException);
 	
     }
commit 1b048cc5d1c5cb7b090dc115f0fe0c1d74924c11
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Tue Nov 20 16:02:02 2007 -0800

    Dix: Re-ebable ErrorF reporting of incorrect refcount in FreeFontPath

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 355ef8a..c21b3ec 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1628,9 +1628,9 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force)
 		    found++;
 	    }
 	    if (list[i]->refcount != found) {
-	      /*		ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
+		ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
 		       list[i]->name_length, list[i]->name,
-		       list[i]->refcount, found); */
+		       list[i]->refcount, found);
 		list[i]->refcount = found; /* ensure it will get freed */
 	    }
 	}


More information about the xorg-commit mailing list