Commit 34cdf06e authored by Daniel Stone's avatar Daniel Stone
Browse files

fb: Remove usage of alloca

Replace with heap storage.
parent 733d4206
......@@ -326,7 +326,7 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1)
{
/* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew1)
return;
pboxBase = pboxNext = pbox+nbox-1;
......@@ -363,11 +363,11 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1)
{
/* reverse order of rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew2)
{
if (pboxNew1)
DEALLOCATE_LOCAL(pboxNew1);
xfree(pboxNew1);
return;
}
pboxBase = pboxNext = pbox;
......@@ -402,9 +402,9 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
reverse, upsidedown, bitPlane, closure);
if (pboxNew1)
DEALLOCATE_LOCAL (pboxNew1);
xfree (pboxNew1);
if (pboxNew2)
DEALLOCATE_LOCAL (pboxNew2);
xfree (pboxNew2);
}
RegionPtr
......
......@@ -500,7 +500,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
DBG("StoreColors\n");
expanddefs = ALLOCATE_LOCAL(sizeof(xColorItem)
expanddefs = xalloc(sizeof(xColorItem)
* (1 << pScrPriv->myDepth));
if (!expanddefs) return;
......@@ -527,7 +527,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
pColors++;
}
DEALLOCATE_LOCAL(expanddefs);
xfree(expanddefs);
pCmapPriv->dirty = TRUE;
pScrPriv->colormapDirty = TRUE;
......@@ -565,9 +565,9 @@ xxInstallColormap(ColormapPtr pmap)
wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap);
}
pixels = ALLOCATE_LOCAL(sizeof(Pixel) * (1 << pScrPriv->myDepth));
colors = ALLOCATE_LOCAL(sizeof(xrgb) * (1 << pScrPriv->myDepth));
defs = ALLOCATE_LOCAL(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
pixels = xalloc(sizeof(Pixel) * (1 << pScrPriv->myDepth));
colors = xalloc(sizeof(xrgb) * (1 << pScrPriv->myDepth));
defs = xalloc(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
if (!pixels || !colors)
return;
......@@ -595,9 +595,9 @@ xxInstallColormap(ColormapPtr pmap)
}
xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs);
DEALLOCATE_LOCAL(pixels);
DEALLOCATE_LOCAL(colors);
DEALLOCATE_LOCAL(defs);
xfree(pixels);
xfree(colors);
xfree(defs);
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment