diff options
author | Jeremy Huddleston <jeremy@yuffie.local> | 2007-11-20 16:15:59 -0800 |
---|---|---|
committer | Jeremy Huddleston <jeremy@yuffie.local> | 2007-11-20 16:15:59 -0800 |
commit | e261f829e423547b719a25f8773ee249c1f84adb (patch) | |
tree | a7cea62a480effaeb42219462d5821a15784bd98 /dix | |
parent | 1b048cc5d1c5cb7b090dc115f0fe0c1d74924c11 (diff) |
DIX: Remove remaining alloca calls
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dispatch.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index b4e8787d2..1cb04233b 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); } |