aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/dix/region.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-07-02 14:11:38 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-07-02 14:11:38 +0200
commit1dbd3c888a3eee51db5303bd93e95b84999f5d31 (patch)
tree84db92271726b42b8c0864c8b7c77b2330566fc1 /nx-X11/programs/Xserver/dix/region.c
parent279d37127db241a9ee685f6b671f51aa21a972ea (diff)
parente85808245810d0cc6918104deef25213d5f9e06c (diff)
downloadnx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.tar.gz
nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.tar.bz2
nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.zip
Merge branch 'sunweaver-pr/backport-Xorg-memory-handling' into 3.6.x
Attributes GH PR #159: https://github.com/ArcticaProject/nx-libs/pull/159 Reviewed by: Vadim Troshchinskiy <vadim@qindel.com> -- Fri, 01 Jul 2016 12:47:46 -0700
Diffstat (limited to 'nx-X11/programs/Xserver/dix/region.c')
-rw-r--r--nx-X11/programs/Xserver/dix/region.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c
index e927b9fde..f2b7224f8 100644
--- a/nx-X11/programs/Xserver/dix/region.c
+++ b/nx-X11/programs/Xserver/dix/region.c
@@ -172,7 +172,7 @@ Equipment Corporation.
((r1)->y1 <= (r2)->y1) && \
((r1)->y2 >= (r2)->y2) )
-#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)
+#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
#define RECTALLOC_BAIL(pReg,n,bail) \
if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
@@ -210,7 +210,7 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
{ \
size_t NewSize = RegionSizeof(numRects); \
RegDataPtr NewData = \
- (NewSize > 0) ? (RegDataPtr)xrealloc((reg)->data, NewSize) : NULL; \
+ (NewSize > 0) ? (RegDataPtr)realloc((reg)->data, NewSize) : NULL; \
if (NewData) \
{ \
NewData->size = (numRects); \
@@ -311,7 +311,7 @@ RegionCreate(rect, size)
{
register RegionPtr pReg;
size_t newSize;
- pReg = (RegionPtr)xalloc(sizeof(RegionRec));
+ pReg = (RegionPtr)malloc(sizeof(RegionRec));
if (!pReg)
return &RegionBrokenRegion;
if (rect)
@@ -324,7 +324,7 @@ RegionCreate(rect, size)
pReg->extents = RegionEmptyBox;
newSize = RegionSizeof(size);
if ((size > 1) && (newSize > 0) &&
- (pReg->data = xalloc(newSize)))
+ (pReg->data = malloc(newSize)))
{
pReg->data->size = size;
pReg->data->numRects = 0;
@@ -342,7 +342,7 @@ RegionDestroy(pReg)
good(pReg);
xfreeData(pReg);
if (pReg != &RegionBrokenRegion)
- xfree(pReg);
+ free(pReg);
}
Bool
@@ -367,7 +367,7 @@ RegionRectAlloc(
{
n++;
rgnSize = RegionSizeof(n);
- pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL;
+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
if (!pRgn->data)
return RegionBreak (pRgn);
pRgn->data->numRects = 1;
@@ -376,7 +376,7 @@ RegionRectAlloc(
else if (!pRgn->data->size)
{
rgnSize = RegionSizeof(n);
- pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL;
+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
if (!pRgn->data)
return RegionBreak (pRgn);
pRgn->data->numRects = 0;
@@ -391,7 +391,7 @@ RegionRectAlloc(
}
n += pRgn->data->numRects;
rgnSize = RegionSizeof(n);
- data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL;
+ data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL;
if (!data)
return RegionBreak (pRgn);
pRgn->data = data;
@@ -795,7 +795,7 @@ RegionOp(
}
if (oldData)
- xfree(oldData);
+ free(oldData);
if (!(numRects = newReg->data->numRects))
{
@@ -1235,7 +1235,7 @@ RegionValidate(badreg, pOverlap)
/* Set up the first region to be the first rectangle in badreg */
/* Note that step 2 code will never overflow the ri[0].reg rects array */
- ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo));
+ ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo));
if (!ri)
return RegionBreak (badreg);
sizeRI = 4;
@@ -1299,7 +1299,7 @@ RegionValidate(badreg, pOverlap)
{
/* Oops, allocate space for new region information */
sizeRI <<= 1;
- rit = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo));
+ rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo));
if (!rit)
goto bail;
ri = rit;
@@ -1355,13 +1355,13 @@ NextRect: ;
numRI -= half;
}
*badreg = ri[0].reg;
- xfree(ri);
+ free(ri);
good(badreg);
return ret;
bail:
for (i = 0; i < numRI; i++)
xfreeData(&ri[i].reg);
- xfree (ri);
+ free (ri);
return RegionBreak (badreg);
}
@@ -1402,7 +1402,7 @@ RegionFromRects(nrects, prect, ctype)
return pRgn;
}
newSize = RegionSizeof(nrects);
- pData = newSize > 0 ? xalloc(newSize) : NULL;
+ pData = newSize > 0 ? malloc(newSize) : NULL;
if (!pData)
{
RegionBreak (pRgn);
@@ -1443,7 +1443,7 @@ RegionFromRects(nrects, prect, ctype)
}
else
{
- xfree (pData);
+ free (pData);
}
return pRgn;
}
@@ -1469,7 +1469,7 @@ miRegionDataCopy(
{
size_t newSize = RegionSizeof(src->data->numRects);
xfreeData(dst);
- dst->data = newSize > 0 ? xalloc(newSize) : NULL;
+ dst->data = newSize > 0 ? malloc(newSize) : NULL;
if (!dst->data)
return RegionBreak (dst);
}