input: calloc minimization for xi2mask_new
authorAdam Jackson <ajax@redhat.com>
Tue, 10 Sep 2013 18:18:18 +0000 (14:18 -0400)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 14 Oct 2013 01:07:37 +0000 (11:07 +1000)
commit5ac4bfca64bd75474e550b26bc1195a5ca245752
tree1728070abf861616de52bdb43c8953cb526df0f3
parent44d502c6f1d03a9e548f0941cde0228b6fde8394
input: calloc minimization for xi2mask_new

There's no reason to do this as (nmasks + 2) callocs, and it's a
surprisingly hot path.  Turns out you hit this ~once per passive grab,
and you do a few bajillion passive grab changes every time you enter or
leave the overview in gnome-shell.  According to a callgrind of Xorg
with gnome-shell-perf-tool run against it:

Ir before: 721437275
Ir after:  454227086

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
dix/inpututils.c