xserver: Branch 'xorg-server-1.2-apple'

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


 dix/dispatch.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

New commits:
commit 96c113724a6298647454261c2d51ae2cf76b5c5a
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Tue Nov 20 16:17:21 2007 -0800

    DIX: Remove remaining alloca calls

diff --git a/dix/dispatch.c b/dix/dispatch.c
index bd9136f..225c4ca 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -368,7 +368,7 @@ Dispatch(void)
     InitSelections();
     nClients = 0;
 
-    clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients);
+    clientReady = (int *) xalloc(sizeof(int) * MaxClients);
     if (!clientReady)
 	return;
 
@@ -489,7 +489,7 @@ Dispatch(void)
     ddxBeforeReset ();
 #endif
     KillAllClients();
-    DEALLOCATE_LOCAL(clientReady);
+    xfree(clientReady);
     dispatchException &= ~DE_RESET;
 }
 
@@ -873,7 +873,7 @@ ProcQueryTree(register 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)
@@ -888,7 +888,7 @@ ProcQueryTree(register ClientPtr client)
     {
     	client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
 	WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
-	DEALLOCATE_LOCAL(childIDs);
+	xfree(childIDs);
     }
 
     return(client->noClientException);
@@ -2572,7 +2572,7 @@ ProcListInstalledColormaps(register ClientPtr client)
         return(BadWindow);
 
     preply = (xListInstalledColormapsReply *) 
-		ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) +
+		xalloc(sizeof(xListInstalledColormapsReply) +
 		     pWin->drawable.pScreen->maxInstalledCmaps *
 		     sizeof(Colormap));
     if(!preply)
@@ -2587,7 +2587,7 @@ ProcListInstalledColormaps(register 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);
 }
 
@@ -2714,7 +2714,7 @@ ProcAllocColorCells (register 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;
@@ -2722,7 +2722,7 @@ ProcAllocColorCells (register 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
@@ -2741,7 +2741,7 @@ ProcAllocColorCells (register ClientPtr client)
 	    client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
 	    WriteSwappedDataToClient(client, length, ppixels);
 	}
-	DEALLOCATE_LOCAL(ppixels);
+	xfree(ppixels);
         return (client->noClientException);        
     }
     else
@@ -2782,7 +2782,7 @@ ProcAllocColorPlanes(register 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,
@@ -2790,7 +2790,7 @@ ProcAllocColorPlanes(register 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
@@ -2805,7 +2805,7 @@ ProcAllocColorPlanes(register ClientPtr client)
 	    client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
 	    WriteSwappedDataToClient(client, length, ppixels);
 	}
-	DEALLOCATE_LOCAL(ppixels);
+	xfree(ppixels);
         return (client->noClientException);        
     }
     else
@@ -2934,12 +2934,12 @@ ProcQueryColors(register 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
@@ -2958,7 +2958,7 @@ ProcQueryColors(register ClientPtr client)
 	    client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
 	    WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
 	}
-	if (prgbs) DEALLOCATE_LOCAL(prgbs);
+	if (prgbs) xfree(prgbs);
 	return(client->noClientException);
 	
     }


More information about the xorg-commit mailing list