diff options
author | Keith Packard <keithp@keithp.com> | 2009-09-17 18:14:31 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-20 20:45:24 +1000 |
commit | 8b5086250aa5dae8de8b763408ff480d7beac819 (patch) | |
tree | 781d7cac5662704a19c528dc590629c5382908b5 /dix | |
parent | c7987660fd665f32406b14db7078a3f5f7b76e9c (diff) |
Eliminate bogus event resizing.
Now that all event queues hold internal events only, they never need
to be resized. Resizing them led to memory corruption as they would
get sized for an appropriate xEvent, not an internal event.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/devices.c | 13 | ||||
-rw-r--r-- | dix/getevents.c | 24 |
2 files changed, 0 insertions, 37 deletions
diff --git a/dix/devices.c b/dix/devices.c index 62574f2cd..e86e606c0 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -281,9 +281,6 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) DeviceIntPtr *prev; int ret; DeviceIntPtr other; - int evsize = sizeof(xEvent); - int listlen; - EventListPtr evlist; BOOL enabled; int flags[MAXDEVICES] = {0}; @@ -325,16 +322,6 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) * list's events have enough memory for a ClassesChangedEvent from the * device */ - - evsize += SizeDeviceClasses(dev); - - listlen = GetEventList(&evlist); - OsBlockSignals(); - SetMinimumEventSize(evlist, listlen, evsize); - mieqResizeEvents(evsize); - OsReleaseSignals(); - - if ((*prev != dev) || !dev->inited || ((ret = (*dev->deviceProc)(dev, DEVICE_ON)) != Success)) { ErrorF("[dix] couldn't enable device %d\n", dev->id); diff --git a/dix/getevents.c b/dix/getevents.c index 46e508002..7ddf88bad 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -964,30 +964,6 @@ InitEventList(int num_events) } /** - * Allocs min_size memory for each event in the list. - */ -void -SetMinimumEventSize(EventListPtr list, int num_events, int min_size) -{ - if (!list) - return; - - while(num_events--) - { - if (list[num_events].evlen < min_size) - { - list[num_events].evlen = min_size; - list[num_events].event = realloc(list[num_events].event, min_size); - if (!list[num_events].event) - { - FatalError("[dix] Failed to set event list's " - "min_size to %d.\n", min_size); - } - } - } -} - -/** * Free an event list. * * @param list The list to be freed. |