diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-02 14:11:38 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-02 14:11:38 +0200 |
commit | 1dbd3c888a3eee51db5303bd93e95b84999f5d31 (patch) | |
tree | 84db92271726b42b8c0864c8b7c77b2330566fc1 /nx-X11/programs/Xserver/dix/resource.c | |
parent | 279d37127db241a9ee685f6b671f51aa21a972ea (diff) | |
parent | e85808245810d0cc6918104deef25213d5f9e06c (diff) | |
download | nx-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/resource.c')
-rw-r--r-- | nx-X11/programs/Xserver/dix/resource.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index b0edbb2aa..40a063891 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -178,7 +178,7 @@ CreateNewResourceType(DeleteType deleteFunc) if (next & lastResourceClass) return 0; - funcs = (DeleteType *)xrealloc(DeleteFuncs, + funcs = (DeleteType *)realloc(DeleteFuncs, (next + 1) * sizeof(DeleteType)); if (!funcs) return 0; @@ -186,7 +186,7 @@ CreateNewResourceType(DeleteType deleteFunc) #ifdef XResExtension { Atom *newnames; - newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); + newnames = realloc(ResourceNames, (next + 1) * sizeof(Atom)); if(!newnames) return 0; ResourceNames = newnames; @@ -231,8 +231,8 @@ InitClientResources(ClientPtr client) lastResourceClass = RC_LASTPREDEF; TypeMask = RC_LASTPREDEF - 1; if (DeleteFuncs) - xfree(DeleteFuncs); - DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * + free(DeleteFuncs); + DeleteFuncs = (DeleteType *)malloc((lastResourceType + 1) * sizeof(DeleteType)); if (!DeleteFuncs) return FALSE; @@ -249,14 +249,14 @@ InitClientResources(ClientPtr client) #ifdef XResExtension if(ResourceNames) - xfree(ResourceNames); - ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); + free(ResourceNames); + ResourceNames = malloc((lastResourceType + 1) * sizeof(Atom)); if(!ResourceNames) return FALSE; #endif } clientTable[i = client->index].resources = - (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); + (ResourcePtr *)malloc(INITBUCKETS*sizeof(ResourcePtr)); if (!clientTable[i].resources) return FALSE; clientTable[i].buckets = INITBUCKETS; @@ -442,7 +442,7 @@ AddResource(XID id, RESTYPE type, void * value) (rrec->hashsize < MAXHASHSIZE)) RebuildTable(client); head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); + res = (ResourcePtr)malloc(sizeof(ResourceRec)); if (!res) { (*DeleteFuncs[type & TypeMask])(value, id); @@ -477,7 +477,7 @@ RebuildTable(int client) tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); if (!tails) return; - resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); + resources = (ResourcePtr *)malloc(j * sizeof(ResourcePtr)); if (!resources) { DEALLOCATE_LOCAL(tails); @@ -505,7 +505,7 @@ RebuildTable(int client) } DEALLOCATE_LOCAL(tails); clientTable[client].buckets *= 2; - xfree(clientTable[client].resources); + free(clientTable[client].resources); clientTable[client].resources = resources; } @@ -535,7 +535,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) elements = --*eltptr; if (rtype != skipDeleteFuncType) (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); + free(res); if (*eltptr != elements) prev = head; /* prev may no longer be valid */ gotOne = TRUE; @@ -568,7 +568,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) *prev = res->next; if (!skipFree) (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); + free(res); break; } else @@ -723,7 +723,7 @@ FreeClientNeverRetainResources(ClientPtr client) { *prev = this->next; (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); + free(this); } else prev = &this->next; @@ -767,10 +767,10 @@ FreeClientResources(ClientPtr client) RESTYPE rtype = this->type; *head = this->next; (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); + free(this); } } - xfree(clientTable[client->index].resources); + free(clientTable[client->index].resources); clientTable[client->index].resources = NULL; clientTable[client->index].buckets = 0; } |