diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:18:22 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:34:46 +0000 |
commit | 934281126f6c602fa4bd0c2e29d8c9f44fe532b8 (patch) | |
tree | 90ae5f5a9d43a266d8ba361764370e6874f079c7 /Xext/sync.c | |
parent | fb32bb9839b615f7297fbfac2050bc216682f01c (diff) |
Xext: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'Xext/sync.c')
-rw-r--r-- | Xext/sync.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Xext/sync.c b/Xext/sync.c index d9b6a9f06..e87e0bd24 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -601,7 +601,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) if (client->clientGone) return; pev = pEvents = (xSyncCounterNotifyEvent *) - ALLOCATE_LOCAL(num_events * sizeof(xSyncCounterNotifyEvent)); + xalloc(num_events * sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); @@ -622,7 +622,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) } /* swapping will be taken care of by this */ WriteEventsToClient(client, num_events, (xEvent *)pEvents); - DEALLOCATE_LOCAL(pEvents); + xfree(pEvents); } @@ -732,7 +732,7 @@ SyncAwaitTriggerFired(pTrigger) pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader; numwaits = pAwaitUnion->header.num_waitconditions; - ppAwait = (SyncAwait **)ALLOCATE_LOCAL(numwaits * sizeof(SyncAwait *)); + ppAwait = (SyncAwait **)xalloc(numwaits * sizeof(SyncAwait *)); if (!ppAwait) goto bail; @@ -801,7 +801,7 @@ SyncAwaitTriggerFired(pTrigger) if (num_events) SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait, num_events); - DEALLOCATE_LOCAL(ppAwait); + xfree(ppAwait); bail: /* unblock the client */ @@ -1396,7 +1396,7 @@ ProcSyncListSystemCounters(client) if (len) { - walklist = list = (xSyncSystemCounter *) ALLOCATE_LOCAL(len); + walklist = list = (xSyncSystemCounter *) xalloc(len); if (!list) return BadAlloc; } @@ -1442,7 +1442,7 @@ ProcSyncListSystemCounters(client) if (len) { WriteToClient(client, len, (char *) list); - DEALLOCATE_LOCAL(list); + xfree(list); } return (client->noClientException); |