On Mon, Dec 08, 2008 at 06:13:36PM +1000, Peter Hutterer wrote:
> + int len = count * sizeof(xEvent);
> + xEvent *ev;
> +
> + /* Assumption: GenericEvents always have count 1 */
> +
> + if (GEV(original)->type == GenericEvent)
> + len += GEV(original)->length * 4;
> +
> + ev = xalloc(len);
> + if (!ev)
> + FatalError("[mi] No memory left for master event.\n");
> + memcpy(ev, original, len);
> + *master = ev;
> +
> + while(count--)Hi, Would it be possible to do something like we do with GPE and friends where you pessimistically allocate based on the maximum possible number of events and only reallocate upwards when necessary? Having malloc() in the event delivery path is a bit of a loss. Cheers, Daniel
signature.asc
Description: Digital signature
_______________________________________________ xorg mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/xorg
