symbols: convert KeyInfo->groups to darray
authorRan Benita <ran234@gmail.com>
Fri, 21 Sep 2012 23:05:48 +0000 (02:05 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Sun, 23 Sep 2012 23:08:54 +0000 (09:08 +1000)
commit428c6f313fe1184d95248b57257a34f339bb0b6d
treeaa7396a09dbcb117e1ce3931eccd24a6801f6afb
parentf671ce07ff58c7685a6bec9ba0faf3227907681d
symbols: convert KeyInfo->groups to darray

Before it was a static array of size XKB_NUM_GROUPS.

The previous cleanups made this transition a bit easier. This is a
first step for removing the XKB_NUM_GROUPS hardcoded limit; but for now
we still check that the groups are < XKB_NUM_GROUPS (e.g. in
ResolveGroup and GetGroupIndex) until the keymap, etc. is worked out as
well.

This also makes us alloc quite a bit less (this is just rulescomp):
Before:
==51999==   total heap usage: 291,474 allocs, 291,474 frees, 21,458,334 bytes allocated
After:
==31394==   total heap usage: 293,595 allocs, 293,595 frees, 18,150,110 bytes allocated
This is because most rmlvo's don't use the full 4 layouts that KeyInfo
had always alloced statically before.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/darray.h
src/xkbcomp/symbols.c