DIX: Remove usage of alloca

Replace with heap allocations.
This commit is contained in:
Daniel Stone 2007-11-05 14:12:59 +00:00
commit 914922fd61
8 changed files with 57 additions and 57 deletions

View file

@ -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