mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-27 21:22:26 +00:00
DIX: Remove usage of alloca
Replace with heap allocations.
This commit is contained in:
parent
3b77689266
commit
914922fd61
8 changed files with 57 additions and 57 deletions
|
|
@ -101,7 +101,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
|
|||
CARD32 tmpbuf[1];
|
||||
|
||||
/* Allocate as big a buffer as we can... */
|
||||
while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize)))
|
||||
while (!(pbufT = (CARD32 *) xalloc(bufsize)))
|
||||
{
|
||||
bufsize >>= 1;
|
||||
if (bufsize == 4)
|
||||
|
|
@ -133,7 +133,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
|
|||
}
|
||||
|
||||
if (pbufT != tmpbuf)
|
||||
DEALLOCATE_LOCAL ((char *) pbufT);
|
||||
xfree ((char *) pbufT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,7 +149,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
|
|||
short tmpbuf[2];
|
||||
|
||||
/* Allocate as big a buffer as we can... */
|
||||
while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize)))
|
||||
while (!(pbufT = (short *) xalloc(bufsize)))
|
||||
{
|
||||
bufsize >>= 1;
|
||||
if (bufsize == 4)
|
||||
|
|
@ -181,7 +181,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
|
|||
}
|
||||
|
||||
if (pbufT != tmpbuf)
|
||||
DEALLOCATE_LOCAL ((char *) pbufT);
|
||||
xfree ((char *) pbufT);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1267,7 +1267,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
|
|||
{
|
||||
char *pInfoTBase;
|
||||
|
||||
pInfoTBase = (char *) ALLOCATE_LOCAL(size);
|
||||
pInfoTBase = (char *) xalloc(size);
|
||||
if (!pInfoTBase)
|
||||
{
|
||||
pClient->noClientException = -1;
|
||||
|
|
@ -1275,7 +1275,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
|
|||
}
|
||||
SwapConnSetupInfo(pInfo, pInfoTBase);
|
||||
(void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
|
||||
DEALLOCATE_LOCAL(pInfoTBase);
|
||||
xfree(pInfoTBase);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
|
|
|
|||
Loading…
Reference in a new issue