mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-30 21:53:25 +00:00
mi: Remove usage of alloca
Replace with heap allocations.
This commit is contained in:
parent
3633ae6efb
commit
be9ee17f96
16 changed files with 128 additions and 128 deletions
|
|
@ -143,21 +143,21 @@ miCopyArea(pSrcDrawable, pDstDrawable,
|
|||
}
|
||||
|
||||
pptFirst = ppt = (DDXPointPtr)
|
||||
ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec));
|
||||
xalloc(heightSrc * sizeof(DDXPointRec));
|
||||
pwidthFirst = pwidth = (unsigned int *)
|
||||
ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int));
|
||||
xalloc(heightSrc * sizeof(unsigned int));
|
||||
numRects = REGION_NUM_RECTS(prgnSrcClip);
|
||||
boxes = REGION_RECTS(prgnSrcClip);
|
||||
ordering = (unsigned int *)
|
||||
ALLOCATE_LOCAL(numRects * sizeof(unsigned int));
|
||||
xalloc(numRects * sizeof(unsigned int));
|
||||
if(!pptFirst || !pwidthFirst || !ordering)
|
||||
{
|
||||
if (ordering)
|
||||
DEALLOCATE_LOCAL(ordering);
|
||||
xfree(ordering);
|
||||
if (pwidthFirst)
|
||||
DEALLOCATE_LOCAL(pwidthFirst);
|
||||
xfree(pwidthFirst);
|
||||
if (pptFirst)
|
||||
DEALLOCATE_LOCAL(pptFirst);
|
||||
xfree(pptFirst);
|
||||
return (RegionPtr)NULL;
|
||||
}
|
||||
|
||||
|
|
@ -264,9 +264,9 @@ miCopyArea(pSrcDrawable, pDstDrawable,
|
|||
if(realSrcClip)
|
||||
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
|
||||
|
||||
DEALLOCATE_LOCAL(ordering);
|
||||
DEALLOCATE_LOCAL(pwidthFirst);
|
||||
DEALLOCATE_LOCAL(pptFirst);
|
||||
xfree(ordering);
|
||||
xfree(pwidthFirst);
|
||||
xfree(pptFirst);
|
||||
return prgnExposed;
|
||||
}
|
||||
|
||||
|
|
@ -433,12 +433,12 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
|
|||
dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv);
|
||||
ValidateGC((DrawablePtr)pPixmap, pGCT);
|
||||
miClearDrawable((DrawablePtr)pPixmap, pGCT);
|
||||
ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec));
|
||||
pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int));
|
||||
ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec));
|
||||
pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int));
|
||||
if(!pptFirst || !pwidthFirst)
|
||||
{
|
||||
if (pwidthFirst) DEALLOCATE_LOCAL(pwidthFirst);
|
||||
if (pptFirst) DEALLOCATE_LOCAL(pptFirst);
|
||||
if (pwidthFirst) xfree(pwidthFirst);
|
||||
if (pptFirst) xfree(pptFirst);
|
||||
FreeScratchGC(pGCT);
|
||||
return;
|
||||
}
|
||||
|
|
@ -464,8 +464,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
|
|||
|
||||
(*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits,
|
||||
pptFirst, pwidthFirst, h, TRUE);
|
||||
DEALLOCATE_LOCAL(pwidthFirst);
|
||||
DEALLOCATE_LOCAL(pptFirst);
|
||||
xfree(pwidthFirst);
|
||||
xfree(pptFirst);
|
||||
|
||||
|
||||
/* Save current values from the client GC */
|
||||
|
|
@ -808,14 +808,14 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage)
|
|||
break;
|
||||
|
||||
case ZPixmap:
|
||||
ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec));
|
||||
pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int));
|
||||
ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec));
|
||||
pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int));
|
||||
if(!pptFirst || !pwidthFirst)
|
||||
{
|
||||
if (pwidthFirst)
|
||||
DEALLOCATE_LOCAL(pwidthFirst);
|
||||
xfree(pwidthFirst);
|
||||
if (pptFirst)
|
||||
DEALLOCATE_LOCAL(pptFirst);
|
||||
xfree(pptFirst);
|
||||
return;
|
||||
}
|
||||
if (pGC->miTranslate)
|
||||
|
|
@ -834,8 +834,8 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage)
|
|||
|
||||
(*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst,
|
||||
pwidthFirst, h, TRUE);
|
||||
DEALLOCATE_LOCAL(pwidthFirst);
|
||||
DEALLOCATE_LOCAL(pptFirst);
|
||||
xfree(pwidthFirst);
|
||||
xfree(pptFirst);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue